-
Notifications
You must be signed in to change notification settings - Fork 628
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
Logging questions #240
Comments
Intentional.
Intentional.
Yes, but still alive and actively used by a bunch of projects including containerd, runc, Moby, BuildKit, ....
What are pros and cons of |
@AkihiroSuda Thanks for providing details on your intent and reminding me to use
There are two pros... First, Go packages often include a specific logging library. These packages used in one place are regularly imported into other applications. When different packages using different logging libraries are imported into one main application we can run into some problems:
Kubernetes is a great example of this. If I read the dependencies right, it is including 8 different logging implementations. Many of these are due to dependencies. log-go provides an interface that can be used all over. Both at the package level and as an interface passed around. Then, the application itself (main) can setup the logger to use everywhere. When a package is imported by someone they can setup the logger of their choice. Second, changing loggers can be a pain. It means modifying the entire application. If a logger becomes deprecated or it doesn't implement a feature you need it's hard to change. Using an interface and being able to change out the logger in just one place make this much easier. There are two cons...
I'm ok with using it or not. I'm happy to do the work in transitioning if you are open to it. Thanks for reading through this. |
Using an interface and configuring it would also solve issues like #112 |
While working on
sudo nerdctl
port forwarding I found myself in need of capturing logs. This is when I noticed the guest agents logs were not easy to work with. I wanted to do a PR to make some more of the logging useful but I wasn't sure what was supposed to happen and I have some opinions on what I'd like to do. So, here are my questions...The text was updated successfully, but these errors were encountered: