Comments (8)
What do you think should happen in the case where you create a field with the name msg
, time
or level
then?
from logrus.
Those should just be fields like any other fields. There shouldn't be magic keys that you have to avoid. If I want to pass "time" as a field meaning "the time the request was originally made," that shouldn't collide with the time the log message was created.
Rob
On May 19, 2014, at 6:14 PM, Simon Eskildsen [email protected] wrote:
What do you think should happen in the case where you create a field with the name msg, time or level then?
—
Reply to this email directly or view it on GitHub.
from logrus.
What should the default field name for time be then? I'm ok with making it up with the formatter, but I'm not getting you completely here.
from logrus.
I mean that Entry should have Msg, Time, and Level members of the struct rather than just mappings in Data:
type Entry struct {
Logger *Logger
Msg string
Time time.Time
Level Level
Data Fields
}
I know there are some backward compatibly questions, but v0.2 suggests your API isn't stable yet, so some breaking changes should be expected (good to do it all at once though). I don't think this will impact people unless they've written their own formatters, though.
This would get rid of lines like:
if key != "time" && key != "level" && key != "msg" {
Rob
On May 19, 2014, at 10:27 PM, Simon Eskildsen [email protected] wrote:
What should the default field name for time be then? I'm ok with making it up with the formatter, but I'm not getting you completely here.
—
Reply to this email directly or view it on GitHub.
from logrus.
Yeah, I'm on board with that and it makes sense. It doesn't solve one of the issues you talked about though, namely what to do in the situation when you log a field with the name msg
, time
or level
.
from logrus.
If you log a field called msg
, time
, or level
, nothing special should happen. It should print out in the list of data fields just like if you log a field called error
or stuff
. That way everything sent to .WithField()
is treated the same.
from logrus.
I really don't get that part of the solution. Can you come up with an example?
from logrus.
from logrus.
Related Issues (20)
- Vulnerability of dependency "gopkg.in/yaml.v3" HOT 2
- Logrus potential DOS - Please open a CVE for issue #1370 to encourage users to patch HOT 3
- Feature: Add slog compatibility layer HOT 5
- logrus+lumberjackrus, After the old log is deleted, the hard drive will not be released, HOT 2
- Vulnerability: gopkg.in/yaml.v3 CVE-2022-28948 HOT 2
- Bazel compilation failling HOT 2
- Question: Any way to view the value of a field from a logrus.FieldLogger? HOT 2
- How to apply colours for a custom log format? HOT 2
- How to safely change Logger.Out on the fly? HOT 2
- How should I position my problem? HOT 2
- Cut a new release with wasip1 support? HOT 4
- github.com/interactive-solutions/go-logrus-elasticsearch cannot find HOT 2
- Bump version of stretchr/testify? HOT 3
- Unclear on documentation regarding Hook interface HOT 3
- Please maintain the CHANGELOG HOT 3
- logger.Out.Write's mutex may be unnecessary, when Out is a file fd HOT 2
- Use for range to output two identical logs
- Update stretchr/testify to 1.9.0 to resolve 2 High sev Vulnerabilities found in go yaml lib from current version HOT 4
- Please reopen and fix https://github.com/sirupsen/logrus/issues/972, skipping caller frames HOT 2
- Why is the directory output by 'file' the directory of the packaging environment? HOT 1
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 logrus.