Comments (12)
I'll return to this near 1.0 release, probably I'll extract abstract logger to separate package under gotd org.
I've seen lots of bad approaches to this problem and just don't want to make another one.
from td.
Seems like duplicate of #15
from td.
Yes, this can be achieved in #15
Currently I can't come with a way of abstracting out zap logging without losing performance or usability.
Can you please provide examples of such "abstract logger"?
from td.
Example is here: https://github.com/go-pkgz/auth/tree/master/logger
This is the library for providing oauth, it also stores its states, logs some events, but there you may provide your own implementation of the store and logger
from td.
// L defined logger interface used everywhere in the package
type L interface {
Logf(format string, args ...interface{})
}
So there are no way to use subloggers, structured logging and verbosity levels.
from td.
Nothing stops you from defining such interface, like:
type Logger interface {
Debug(format string, args ...interface{})
Info(format string, args ...interface{})
Warn(format string, args ...interface{})
With(info string) Logger // adds additional information to the logger
Named(name string) Logger // creates a sublogger
}
at least it adds some flexibility around the logger, while the library is strictly tied to zap
.
from td.
I need statically typed structured logger with good performance, if someone will come up with zap-like interface for abstract logger I'm ok with it.
from td.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
from td.
keep
from td.
I've seen lots of bad approaches to this problem and just don't want to make another one.
Here is my 2c, the best performance logger (for both logging and parsing) that I found is
https://github.com/go-kit/log
(There are some benchmarks & comparisons links at the end of it)
which is also a structured logger --
- Using a stricter, key/value-oriented message format for our logs, containing contextual and semantic information, makes it much easier to get insight into the operational activity of the systems we build.
- Migrating from unstructured to structured logging is probably a lot easier than you'd expect.
- And as last resort, you can redirect stdlib logger to Go kit logger too.
For more details on the evolution of the Logger interface, see The Hunt for a Logger Interface, a talk by Chris Hines.
All in all, it is a minimal and extensible structured logger
from td.
Currently I'm waiting for https://github.com/open-telemetry/opentelemetry-go implementation of logging API.
from td.
Also structured logging proposal just got accepted:
golang/go#56345
from td.
Related Issues (20)
- how to get the sender's information from MessagesChannelMessages? HOT 3
- how to get the string returned by clicking the button
- subject: short description HOT 2
- How to deal with client.API().MessagesGetBotCallbackAnswer error
- Get sender information HOT 1
- The file I sent does not have a name HOT 1
- My account has been banned HOT 5
- The utilization of an MTP proxy will invariably result in the failure of 'MessagesGetDialogs'.
- Can't send message to a group HOT 1
- How to get paticipaints in channel/group?
- Error when connect client unable to decode Vector<User>: field Elems: unable to decode UserClass: unexpected id 0x8f97c628 HOT 8
- Error #01: upload part: send upload part 1501 RPC: rpcDoRequest: retryUntilAck: engine forcibly closed: context canceled HOT 3
- ChannelsEditAdmin throwing USER_ID_INVALID for bots
- OnNewMessage update handler doesn't work correct HOT 3
- Client ping panics on direct call
- `AUTH_BYTES_INVALID` on parallel download of files
- Write some examples about secret chat HOT 1
- client.UsersGetUsers doesn't return users with ID of type int64
- Channel recommendations pagination support
- GetMessageLinkRequest to get the message link and always get an error: INPUT_METHOD_INVALID.
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 td.