Skip to content

Commit d4ee17b

Browse files
author
Eugene Rodionov
committed
chore: new title formatting
1 parent ca4a872 commit d4ee17b

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "redux-logger",
3-
"version": "2.5.1",
3+
"version": "2.5.2",
44
"description": "Logger for redux",
55
"main": "lib/index.js",
66
"scripts": {

src/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const repeat = (str, times) => (new Array(times + 1)).join(str);
22
const pad = (num, maxLength) => repeat(`0`, maxLength - num.toString().length) + num;
3-
const formatTime = (time) => ` @ ${pad(time.getHours(), 2)}:${pad(time.getMinutes(), 2)}:${pad(time.getSeconds(), 2)}.${pad(time.getMilliseconds(), 3)}`;
3+
const formatTime = (time) => `@ ${pad(time.getHours(), 2)}:${pad(time.getMinutes(), 2)}:${pad(time.getSeconds(), 2)}.${pad(time.getMilliseconds(), 3)}`;
44

55
// Use the new performance api to get better precision if available
66
const timer = typeof performance !== `undefined` && typeof performance.now === `function` ? performance : Date;
@@ -70,7 +70,7 @@ function createLogger(options = {}) {
7070

7171
const formattedTime = formatTime(startedTime);
7272
const titleCSS = colors.title ? `color: ${colors.title(formattedAction)};` : null;
73-
const title = `action ${formattedAction.type}${timestamp ? formattedTime : ``}${duration ? ` in ${took.toFixed(2)} ms` : ``}`;
73+
const title = `action ${timestamp ? formattedTime : ``} ${formattedAction.type} ${duration ? `(in ${took.toFixed(2)} ms)` : ``}`;
7474

7575
// render
7676
try {

0 commit comments

Comments
 (0)