-
-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Closed
Description
In #13138 we made all logging (info, warn, error) log to stderr and let stdout be reserved for program output.
When you run hugo against a project that includes a module that has not been downloaded yet, this is written to stdout:
hugo: collected modules in 962 ms
If you run the command hugo list all before the module has been downloaded, the resulting CSV data is invalid.
If seems like the message above should be logged to stdErr instead.
Line 509 in 5d64b49
| defer c.logger.PrintTimerIfDelayed(time.Now(), "hugo: collected modules") |
Lines 270 to 279 in 5d64b49
| // PrintTimerIfDelayed prints a time statement to the FEEDBACK logger | |
| // if considerable time is spent. | |
| func (l *logAdapter) PrintTimerIfDelayed(start time.Time, name string) { | |
| elapsed := time.Since(start) | |
| milli := int(1000 * elapsed.Seconds()) | |
| if milli < 500 { | |
| return | |
| } | |
| l.Printf("%s in %v ms", name, milli) | |
| } |
Can we replace the last line in the above with this?
fmt.Fprintf(l.stdErr, "%s in %v ms", name, milli)