aboutsummaryrefslogtreecommitdiffstats
path: root/packages/utils
diff options
context:
space:
mode:
authorSteve Klebanoff <steve.klebanoff@gmail.com>2018-12-22 06:57:16 +0800
committerSteve Klebanoff <steve.klebanoff@gmail.com>2018-12-22 06:57:16 +0800
commite144ebbb936c74b4af0e1c1776578208ea148de4 (patch)
treec5ab2823603b25d11d46493e9c8f79801bef0dcd /packages/utils
parentaa9aa1f58a4e63b5e5c7863f3b7afb020d7712c5 (diff)
parent9b540fd8e52e7578d3749e6d9ef9cd97d602ffb3 (diff)
downloaddexon-sol-tools-e144ebbb936c74b4af0e1c1776578208ea148de4.tar
dexon-sol-tools-e144ebbb936c74b4af0e1c1776578208ea148de4.tar.gz
dexon-sol-tools-e144ebbb936c74b4af0e1c1776578208ea148de4.tar.bz2
dexon-sol-tools-e144ebbb936c74b4af0e1c1776578208ea148de4.tar.lz
dexon-sol-tools-e144ebbb936c74b4af0e1c1776578208ea148de4.tar.xz
dexon-sol-tools-e144ebbb936c74b4af0e1c1776578208ea148de4.tar.zst
dexon-sol-tools-e144ebbb936c74b4af0e1c1776578208ea148de4.zip
Merge branch 'development' into feature/instant/tell-amount-available
Diffstat (limited to 'packages/utils')
-rw-r--r--packages/utils/CHANGELOG.json9
-rw-r--r--packages/utils/package.json1
-rw-r--r--packages/utils/src/log_utils.ts5
3 files changed, 15 insertions, 0 deletions
diff --git a/packages/utils/CHANGELOG.json b/packages/utils/CHANGELOG.json
index fe66d3f31..605151fb6 100644
--- a/packages/utils/CHANGELOG.json
+++ b/packages/utils/CHANGELOG.json
@@ -1,5 +1,14 @@
[
{
+ "version": "2.1.0",
+ "changes": [
+ {
+ "note": "Add `logWithTime` to `logUtils`",
+ "pr": 1461
+ }
+ ]
+ },
+ {
"version": "2.0.8",
"changes": [
{
diff --git a/packages/utils/package.json b/packages/utils/package.json
index a25dc9cff..5ffec049a 100644
--- a/packages/utils/package.json
+++ b/packages/utils/package.json
@@ -49,6 +49,7 @@
"@types/node": "*",
"abortcontroller-polyfill": "^1.1.9",
"bignumber.js": "~4.1.0",
+ "chalk": "^2.4.1",
"detect-node": "2.0.3",
"ethereum-types": "^1.1.4",
"ethereumjs-util": "^5.1.1",
diff --git a/packages/utils/src/log_utils.ts b/packages/utils/src/log_utils.ts
index 87f8479b5..6d9996c67 100644
--- a/packages/utils/src/log_utils.ts
+++ b/packages/utils/src/log_utils.ts
@@ -1,3 +1,5 @@
+import chalk from 'chalk';
+
export const logUtils = {
log(...args: any[]): void {
console.log(...args); // tslint:disable-line:no-console
@@ -5,4 +7,7 @@ export const logUtils = {
warn(...args: any[]): void {
console.warn(...args); // tslint:disable-line:no-console
},
+ logWithTime(arg: string): void {
+ logUtils.log(`[${chalk.gray(new Date().toLocaleTimeString())}] ${arg}`);
+ },
};