mirror of https://github.com/status-im/metro.git
Packager: Shorter + Consistent-Width Timestamps
Summary: Sets some options on `toLocaleString()` so that the server debug output's timestamps are shorter and have a consistent width (zero-padded). Reviewed By: cpojer Differential Revision: D4235074 fbshipit-source-id: 72dcf35ffd182eb70afc20d2b266314787433c4a
This commit is contained in:
parent
90197e919b
commit
0b7a6d830f
|
@ -23,6 +23,16 @@ import type {
|
||||||
LogEntry,
|
LogEntry,
|
||||||
} from './Types';
|
} from './Types';
|
||||||
|
|
||||||
|
const DATE_LOCALE_OPTIONS = {
|
||||||
|
day: '2-digit',
|
||||||
|
hour12: false,
|
||||||
|
hour: '2-digit',
|
||||||
|
minute: '2-digit',
|
||||||
|
month: '2-digit',
|
||||||
|
second: '2-digit',
|
||||||
|
year: 'numeric',
|
||||||
|
};
|
||||||
|
|
||||||
let PRINT_LOG_ENTRIES = true;
|
let PRINT_LOG_ENTRIES = true;
|
||||||
const log_session = `${os.hostname()}-${Date.now()}`;
|
const log_session = `${os.hostname()}-${Date.now()}`;
|
||||||
const eventEmitter = new EventEmitter();
|
const eventEmitter = new EventEmitter();
|
||||||
|
@ -95,7 +105,7 @@ function print(
|
||||||
duration_ms: duration,
|
duration_ms: duration,
|
||||||
} = logEntry;
|
} = logEntry;
|
||||||
|
|
||||||
const timeStamp = new Date().toLocaleString();
|
const timeStamp = new Date().toLocaleString(undefined, DATE_LOCALE_OPTIONS);
|
||||||
let logEntryString;
|
let logEntryString;
|
||||||
|
|
||||||
switch (actionPhase) {
|
switch (actionPhase) {
|
||||||
|
|
Loading…
Reference in New Issue