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
feat: separate configs for --timing and --loglevel
BREAKING CHANGE: `timing` and `loglevel` changes
- `timing` has been removed as a value for `--loglevel`
- `--timing` will show timing information regardless of
`--loglevel`, except when `--silent`
Closesnpm/statusboard#455Closesnpm/statusboard#454
Copy file name to clipboardexpand all lines: docs/lib/content/using-npm/logging.md
+10-2
Original file line number
Diff line number
Diff line change
@@ -14,6 +14,9 @@ All logs are written to a debug log, with the path to that file printed if the e
14
14
15
15
The default location of the logs directory is a directory named `_logs` inside the npm cache. This can be changed with the `logs-dir` config option.
16
16
17
+
For example, if you wanted to write all your logs to the current working directory, you could run: `npm install --logs-dir=.`. This is especially helpful in debugging a specific `npm` issue as you can run
18
+
a command multiple times with different config values and then diff all the log files.
19
+
17
20
Log files will be removed from the `logs-dir` when the number of log files exceeds `logs-max`, with the oldest logs being deleted first.
18
21
19
22
To turn off logs completely set `--logs-max=0`.
@@ -31,7 +34,6 @@ The default value of `loglevel` is `"notice"` but there are several levels/types
31
34
-`"warn"`
32
35
-`"notice"`
33
36
-`"http"`
34
-
-`"timing"`
35
37
-`"info"`
36
38
-`"verbose"`
37
39
-`"silly"`
@@ -57,15 +59,21 @@ The `npm` CLI began hiding the output of lifecycle scripts for `npm install` as
57
59
58
60
### Timing Information
59
61
60
-
The [`--timing` config](/using-npm/config#timing) can be set which does two
62
+
The [`--timing` config](/using-npm/config#timing) can be set which does a few
61
63
things:
62
64
63
65
1. Always shows the full path to the debug log regardless of command exit status
64
66
1. Write timing information to a process specific timing file in the cache or `logs-dir`
67
+
1. Output timing information to the terminal
65
68
66
69
This file contains a `timers` object where the keys are an identifier for the
67
70
portion of the process being timed and the value is the number of milliseconds it took to complete.
68
71
72
+
Sometimes it is helpful to get timing information without outputting anything to the terminal. For
73
+
example, the performance might be affected by writing to the terminal. In this case you can use
74
+
`--timing --silent` which will still write the timing file, but not output anything to the terminal
0 commit comments