diff --git a/package-lock.json b/package-lock.json index 14e9719ab..34c239dcb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19,7 +19,6 @@ "browserify": "13.3.0", "chalk": "2.4.2", "clear-require": "1.0.1", - "date-fns": "2.29.3", "debug": "2.6.9", "devtools": "8.21.0", "expect-webdriverio": "3.5.3", @@ -35,6 +34,7 @@ "png-validator": "1.1.0", "sharp": "0.32.6", "sizzle": "2.3.6", + "strftime": "0.10.2", "strip-ansi": "6.0.1", "temp": "0.8.3", "uglifyify": "3.0.4", @@ -6275,18 +6275,6 @@ "node": ">=10" } }, - "node_modules/date-fns": { - "version": "2.29.3", - "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-2.29.3.tgz", - "integrity": "sha512-dDCnyH2WnnKusqvZZ6+jA1O51Ibt8ZMRNkDZdyAyK4YfbDwa/cEmuztzG5pk6hqlp9aSBPYcjOlktquahGwGeA==", - "engines": { - "node": ">=0.11" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/date-fns" - } - }, "node_modules/dateformat": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-3.0.3.tgz", @@ -13919,6 +13907,14 @@ "queue-tick": "^1.0.1" } }, + "node_modules/strftime": { + "version": "0.10.2", + "resolved": "https://registry.npmjs.org/strftime/-/strftime-0.10.2.tgz", + "integrity": "sha512-Y6IZaTVM80chcMe7j65Gl/0nmlNdtt+KWPle5YeCAjmsBfw+id2qdaJ5MDrxUq+OmHKab+jHe7mUjU/aNMSZZg==", + "engines": { + "node": ">=0.2.0" + } + }, "node_modules/string_decoder": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", @@ -21274,11 +21270,6 @@ "whatwg-url": "^8.0.0" } }, - "date-fns": { - "version": "2.29.3", - "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-2.29.3.tgz", - "integrity": "sha512-dDCnyH2WnnKusqvZZ6+jA1O51Ibt8ZMRNkDZdyAyK4YfbDwa/cEmuztzG5pk6hqlp9aSBPYcjOlktquahGwGeA==" - }, "dateformat": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-3.0.3.tgz", @@ -26965,6 +26956,11 @@ "queue-tick": "^1.0.1" } }, + "strftime": { + "version": "0.10.2", + "resolved": "https://registry.npmjs.org/strftime/-/strftime-0.10.2.tgz", + "integrity": "sha512-Y6IZaTVM80chcMe7j65Gl/0nmlNdtt+KWPle5YeCAjmsBfw+id2qdaJ5MDrxUq+OmHKab+jHe7mUjU/aNMSZZg==" + }, "string_decoder": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", diff --git a/package.json b/package.json index 8f5ebcd87..c0ed60e65 100644 --- a/package.json +++ b/package.json @@ -54,7 +54,6 @@ "browserify": "13.3.0", "chalk": "2.4.2", "clear-require": "1.0.1", - "date-fns": "2.29.3", "debug": "2.6.9", "devtools": "8.21.0", "expect-webdriverio": "3.5.3", @@ -70,6 +69,7 @@ "png-validator": "1.1.0", "sharp": "0.32.6", "sizzle": "2.3.6", + "strftime": "0.10.2", "strip-ansi": "6.0.1", "temp": "0.8.3", "uglifyify": "3.0.4", diff --git a/src/utils/logger.js b/src/utils/logger.js index e66fe452b..3a86c3ef6 100644 --- a/src/utils/logger.js +++ b/src/utils/logger.js @@ -1,11 +1,11 @@ "use strict"; -const { format } = require("date-fns"); +const format = require("strftime"); const withTimestampPrefix = logFnName => (...args) => { - const timestamp = format(new Date(), "HH:mm:ss OO"); + const timestamp = format("%H:%M:%S %z"); console[logFnName](`[${timestamp}]`, ...args); }; diff --git a/test/src/utils/logger.js b/test/src/utils/logger.js index eee4d4869..5563002c5 100644 --- a/test/src/utils/logger.js +++ b/test/src/utils/logger.js @@ -26,7 +26,7 @@ describe("utils/logger", () => { it("should start with timestamp message", () => { logger[logFnName]("message", "another message"); - assert.calledOnceWith(console[logFnName], "[14:21:04 GMT+3]", "message", "another message"); + assert.calledOnceWith(console[logFnName], "[14:21:04 +0300]", "message", "another message"); }); }); });