Skip to content
This repository has been archived by the owner on Jun 3, 2020. It is now read-only.

v0.7.0 syntax for errors #384

Open
gaia opened this issue Dec 17, 2019 · 3 comments
Open

v0.7.0 syntax for errors #384

gaia opened this issue Dec 17, 2019 · 3 comments

Comments

@gaia
Copy link

gaia commented Dec 17, 2019

v0.7.0's more forgiving timeouts are a welcome feature, thanks!

I noted that the log syntax changed in v0.7.0. I used the older syntax as a search query in papertrail to get realtime alerts on undesired events, and it used to be [warn] OR [error].

It is now #033[0m#033[31mERROR#033[0m OR #033[0m#033[31mWARN#033[0m. Was this an oversight or will warnings/errors be logged in this format from here on?

@tarcieri
Copy link
Contributor

This was caused by a switch to the tracing crate for logging:

https://github.com/tokio-rs/tracing

That crate is pretty much the permanently planned logging system, however it seems you are getting color logs when you probably don't want color.

It should autodetect if it's running under a TTY and not use colors if it isn't. Are you running it with a TTY?

Otherwise I should probably add a config option for whether or not colors should be used (and/or a command line argument or env var)

@gaia
Copy link
Author

gaia commented Dec 17, 2019

Yes, looking at the logs directly in the client (/dev/pts/0) it is formatted properly

Dec 17 16:36:37.265 ERROR tmkms::client:

while via papertrail:

#033[2mDec 17 16:36:37.265 #033[0m#033[31mERROR#033[0m tmkms::client:

weird though is tmkms are the only logs for which this happens in papertrail. it's standard rsyslog for shipping logs to papertrail (with TLS)

How do I disable coloring?

image

@tarcieri
Copy link
Contributor

I will look into adding some configuration to control when it uses colors. It also looks like the TTY detection may have regressed, so I will try to add that back.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants