You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+17-5Lines changed: 17 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -27,27 +27,39 @@ log.error('oh no!');
27
27
### `log(msg...)`
28
28
29
29
Logs the message as if you called `console.log` but prefixes the output with the
30
-
current time in HH:MM:ss format.
30
+
current time in HH:mm:ss format.
31
31
32
32
### `log.error(msg...)`
33
33
34
34
Logs the message as if you called `console.error` but prefixes the output with the
35
-
current time in HH:MM:ss format.
35
+
current time in HH:mm:ss format.
36
36
37
37
### `log.warn(msg...)`
38
38
39
39
Logs the message as if you called `console.warn` but prefixes the output with the
40
-
current time in HH:MM:ss format.
40
+
current time in HH:mm:ss format.
41
41
42
42
### `log.info(msg...)`
43
43
44
44
Logs the message as if you called `console.info` but prefixes the output with the
45
-
current time in HH:MM:ss format.
45
+
current time in HH:mm:ss format.
46
46
47
47
### `log.dir(msg...)`
48
48
49
49
Logs the message as if you called `console.dir` but prefixes the output with the
50
-
current time in HH:MM:ss format.
50
+
current time in HH:mm:ss format.
51
+
52
+
## Styling
53
+
54
+
If the terminal that you are logging to supports colors, the timestamp will be formatted as though it were a `Date` being formatted by `util.inspect()`. This means that it will be formatted as magenta by default but can be adjusted following node's [Customizing util.inspect colors](https://nodejs.org/dist/latest-v10.x/docs/api/util.html#util_customizing_util_inspect_colors) documentation.
55
+
56
+
For example, this will cause the logged timestamps (and other dates) to display in red:
0 commit comments