-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Timestamp in debug message? #5
Comments
Definitely. I thought it was already in there.
|
My original plan was to remove DebugLogger because it really doesn't fit here as a complete logging provider. It doesn't have a bunch of stuff like log levels, filtering based on levels and built-in libraries for basic transports. It's use is best for just debug statements as the name suggests. I have some more digging to do on the custom redirection of its logs and then take the decision of either removing it or enhancing it. |
@Himavanth I think debug logs are useful for libraries, in libraries you don't want to log things unless you are debugging. |
@moritzraho Winston does have debug mode as one of several log levels. |
ok but is there a way for the user of a library (that logs using winston.debug) to turn debug logs on/off like in the debug module ? |
Right now you would do it like this, to only show
To turn other debug levels on, you add them as comma separated values:
However, this is not how debug levels should work. The levels should accumulate. For example, the |
@shazron Correct. Debug package is very rudimentary and does not have this feature (and others like custom transports) which means we would have to build it ourselves (it's not a lot of effort though). I spent the first part of this week trying to figure out if it makes sense for us to support it. I have built a custom transport for sending logs to a runtime action here https://github.com/adobe/aio-lib-core-logging/tree/logcollector. Looks like it's ok to give it a try building some of the features in debug package. |
Is this still an issue? |
@moritzraho @Himavanth is this still an issue? |
Not sure, I would say yes, but then as @Himavanth mentioned we might end up having to add many other features to the debug provider. |
@moritzraho @shazron @Himavanth any conclusion on this one? |
debug npm does not log timestamps when stdout is tty but it does if stdout is say a file. Looks like it is pretty much hardcoded in that aspect. A workaround is to use It will be good if winston can be controlled using the DEBUG env var. But we will have to implement a tiny parser here because DEBUG var supports wildcard and "excluding" as well. |
Wdyt?
The text was updated successfully, but these errors were encountered: