-
Notifications
You must be signed in to change notification settings - Fork 670
Conversation
I am curious what the resolution to #329 would look like with this change. To date that's the only justification provided for dragging in an external logging library. |
LGTM. I was wondering if logrus could make things easier for identifying the module/package where the log line was generated, so we could get rid of things like |
@inercia not sure whether you meant easier in the code that generates the log line or easier for the person reading the log file. I'll answer the former. The typical pattern I've seen is using It should be possible to use logrus' "fields" feature to set the module and bring it out again in the formatter. |
@bboreham Yes, the |
I suggest (a) that should be filed as a separate issue and (b) we should carefully consider what the log-file format of such messages should be. It is very useful to be able to reliably search them, so a format like |
I agree with both points. Parseability is probably not really necessary. I was more concerned with a) a common calling convention and b) a common log line formatting... |
Quick note: I should fix the way millisecond numbers are currently stripped of trailing zeros. |
- note that all output is now going to stderr.
I fixed the milliseconds and rebased off master. |
Why not get rid of |
It was an extra ~50 edits, and I see the argument that it's more consistent to lose it. I could be swayed. |
sway sway sway |
I would remove it... 👍 |
remove it. |
Removed. |
Use off-the-shelf logger logrus Closes #664.
As discussed in #664
We have our own formatting routine, because the standard logrus one has surprising behaviour like adding extra spaces on the end of lines and inserting colour-changing escape sequences.
One side-effect of this change is that all logging now comes on stderr, rather than some on stdout and some on stderr as before. The weave script needs two changes to accommodate this. Closes #1039.
The previous style of having
Debug.Println()
orError.Println()
isn't supported by logrus, so such code changes toLog.Debugln()
andLog.Errorln()
respectively. We provide anInfo
reference soInfo.Println()
still works.