Comments (8)
Colour (!) me interested in this too - like @Dango-rs, I'm moving from another log framework which exposed this feature and this would be nice to have.
If there's interest in taking it, I could look at putting together a PR to implement it?
I'm thinking I'd want to look at adding some sort of mapping from level to colour in PatternEncoder as a first step, then expose that as a configuration item. It feels like it would be too much to try to shoehorn into the pattern itself though, so (using the example YAML config) I'd do something like this:
# An appender named "stdout" that writes to stdout
stdout:
kind: console
encoder:
pattern: "{d} {h({l})} {m}{n}"
level_colors:
INFO: Green
WARN: Yellow
ERROR: Red
Then go from those strings to Color values, using no colour where there's no match (so, for example, if I do TRACE: DeepPurple, that gets ignored).
Does that all seem reasonable?
from log4rs.
I recently moved to this crate due to the support of both console and file logging and I can confirm that the blue color is really unreadable on my term as well with default color settings, so i don't believe this matter should be closed.
The colors should either be updated with the same as env_logger (I was previously using that crate) or they should have the ability to be configurable. So far I didn't found any functionality how can I configure the colors from the builder.
from log4rs.
Right now the dark blue color (info level) is really hard to read on a black background.
It would be great if the defaults were improved for legibility, or if the colors could be made configurable.
from log4rs.
Your terminal controls what the colors look like: https://en.wikipedia.org/wiki/ANSI_escape_code#Colors
from log4rs.
Yes, but dark blue is pretty dark on most systems. Cyan as a default might be easier to read. Or a blueish color in 256-color mode.
from log4rs.
Ah, gotcha. I pulled the color selection from https://logback.qos.ch/manual/layouts.html#coloring but don't feel particularly strongly about the specifics.
from log4rs.
Does anyone still care about this? I'm going to close if not.
from log4rs.
consider add support for level color, just like this: ColoredLevelConfig
from log4rs.
Related Issues (20)
- how to config time format and how to define fields when using json encoder HOT 1
- Add support for force color
- Why log4rs don't support time-based rotate? HOT 4
- will log4rs support zeromq appender?
- Support for KafkaAppender HOT 1
- Abbility to change case/word for logs
- Example for setting up log rotation HOT 1
- Prevent log4rs from creating $ENV{HOME} folders everywhere HOT 4
- c
- Real ip in the logs HOT 1
- Using custom appenders needs more documentation HOT 4
- Feature request logger filter
- Support for Key-Value Pairs HOT 1
- Redirect to a custom function using a custom appender
- Investigate and Resolve issues with Raw Config Deserializer HOT 1
- [bug] wrong thread id in linux HOT 6
- Publish on crates.io HOT 2
- Do you use any optimisations to log in file?
- README out of date with the 1.0 version HOT 2
- Clippy fails with log4rs HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from log4rs.