-
Notifications
You must be signed in to change notification settings - Fork 126
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
SNOW-625282: Make logrus dependency optional or drop it all together #616
Comments
Any feedback on this? If accept I could start a pr. |
hi, thank you for submitting this request with us. we'll take a look - as with other enhancements, can't promise any timeline on the ETTR so thank you for bearing with us ! |
I would also be interested in dropping logging. I don't think it's very common to do arbitrary logging from libraries like this. I think removing the logging and propagating errors to the caller would make more sense. If it's not an error I don't think it needs to be logged. If however you still want to use logging from this codebase, maybe considering something more flexible like logr which has an extensive list of implementations or create your own slimmed down interface uses can implement themselves (info- and error severity should be enough). And if that also isn't of interest, maybe you could expose the global logger here so users can overwrite it? |
Hi all! We started considering this issue! I have a strong Java background and in Java we have a wonderful SLF4J library which is de facto a standard for Java logging API. SLF4J is not a logger itself, it is more like an API which is implemented by multiple logging libraries like logback or log4j. Still, this is great, because all libraries use only SLF API and not come with logging backend of their choice. Not sure if this is it, but it seems that in Go similar library is https://github.com/go-logr/logr Another solution might be to use https://go.dev/blog/slog . Unfortunately, this is brand new thing, which was introduced in Go 1.21. We have to support older go versions for a few couple of quarters (fingers crossed that less than more). If you are interested in such changes, please add a reaction. Thanks in advance! |
Thanks for picking this up! As I wrote in my previous post I'd rather not have logs at all and I'm not sure any of And browsing the code now again I see that you seem to have some magic word where setting the level to Lines 49 to 60 in 5c89d42
Since I seem to be able to get the global logger with Lines 413 to 415 in 5c89d42
I guess I should be able to turn it off completely with: gosnowflake.GetLogger().SetLogLevel("OFF") Maybe it would be worth documenting that and/or using that example in So with my issue solved, I guess that the most flexible way to consider most users log setup and also the one you wrote would be fastest, moving to |
The dependency on logrus creates two problems:
Would it be possible to make the logrus dependency optional or maybe remove it all together?
The text was updated successfully, but these errors were encountered: