- 
                Notifications
    
You must be signed in to change notification settings  - Fork 4.6k
 
Replace grpclog with dlog #341
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
Conversation
| 
           Thanks for contributing. I got some concerns on this change:  | 
    
| 
           Moving this into grpc repo is the way to go if you are not against it.  | 
    
| 
           On ii) - I can rename it to glogger again, so there's no confusion. In general though, that glog package would only ever be imported once, probably in a main package, it shouldn't be referenced in general i.e.: On moving it into grpc - I'm generally fine with this, I just wanted to use dlog in the future for other libraries (mostly my own), so making it grpc-specific is no fun for that. But with that said, totally get the "no external dependencies", and since for my own stuff I just use protolog...eh why not, let's just move it in. I'll move dlog to grpc/grpclog, and add all the package comments/import etc, how does that sound? I'll probably just do a new PR so there's no wasted commits. If you give me the go (pun intended?), I'll write up this PR now.  | 
    
| 
           I can't say I'm a fan of the trend this is extending. Logging has been made over-complicated. Arguably grpc-go shouldn't even need to use glog. There's too many places where grpc-go logs, where it should instead report via some better channel.  | 
    
| 
           I would say there's an argument to be made that grpc does too much logging in some places, but I think that's another concept that should be tackled - what this PR (and the equivalent one over on grpc-gateway) is trying to cover is that every library is choosing their own logger, and it makes end-user applications hard to coalesce all logging to a preferred system. Just my two cents.  | 
    
| 
           @iamqizhao I just put the other PR together for your review since it only took a few minutes  | 
    
| 
           @dsymonds I'm pretty sure you saw this since you're a collaborator but just in case, this was our original discussion re: grpclog: #190 The main thing is it's hard to capture grpc's logs in some systems (well I guess that's empirical evidence, but ya, the systems I've worked on :) ) because not everyone uses glog. So you end up either ignoring grpc's logs (the usual solution), which isn't great, whether grpc is logging too much or not, or you have to redirect glog into your own logging system.  | 
    
| 
           I'm not really trying to hold up this particular pull request, just expressing my dissatisfaction. Maybe channeling some of Rob Pike too. Too many things just log random information instead of thinking harder about why one would care about a particular situation arising, and thus all this great infrastructure around logging gets built to cope with that.  | 
    
| 
           I totally agree actually - I think when adding a long-term log message, it should be something actionable or meaningful. And on that line, totally happy to help grpc-go with this, because it is definitely a bit noisy. This was sort of the motivation (plugging my own package) for go.pedge.io/protolog - it allows you to do generic logging, but the main use is to make a proto message for everything you log (log "events"), and you get somewhat of an artificial barrier to adding a new log message - emotionally, you think more about "do I really want to log this/make a new log message for this" before adding a log line. Small example (not using protolog much yet, but we're getting there): https://github.com/pachyderm/pachyderm/tree/master/src/pps/server But ya, end of plug :)  | 
    
| 
           I always think the library developers are sorta biased when they add the logging to their lib. The logs they added probably only benefit themselves and not even readable to users. Therefore, I am very willing to listen to the feedback from our users on logging and make the corresponding changes. The current logging information were from our code reviewers and users besides myself. I agree that they are not in a very decent form at the current stage due to the long dev period without a refinement and lack of level logging support in the standard log package. We can definitely do a refinement and make it better in near future.  | 
    
| 
           For sure :)  | 
    
See this issue for context: grpc#341 (comment)
See this issue for context: grpc#341 (comment)
This is re: grpc-ecosystem/grpc-gateway#54
So the idea is, both grpc-go and grpc-gateway use dlog to abstract logging libraries away. There is no effective change to grpc-go other than grpclog is deleted. To use glog, instead of doing:
One would do:
For reference, go.pedge.io/dlog has TLS/SSL: