{"repo":"go-logr/logr","free":true,"listed":false,"github":"https://github.com/go-logr/logr","clone":"git clone https://github.com/go-logr/logr.git","description":"A simple logging interface for Go","language":"Go","stars":1400,"topics":["logging","logger"],"license":"Apache-2.0","category":"analytics","readme_excerpt":"A minimal logging API for Go logr offers an(other) opinion on how Go programs and libraries can do logging without becoming coupled to a particular logging implementation. This is not an implementation of logging - it is an API. In fact it is two APIs with two different sets of users. The Logger type is intended for application and library authors. It provides a relatively small API which can be used everywhere you want to emit logs. It defers the actual act of writing logs (to files, to stdout, or whatever) to the LogSink interface. The LogSink interface is intended for logging library implementers. It is a pure interface which can be implemented by logging frameworks to provide the actual logging functionality. This decoupling allows application and library developers to write code in terms of logr.Logger (which has very low dependency fan-out) while the implementation of logging is managed \"up stack\" (e.g. in or near main() .) Application developers can then switch out implementations as necessary. Many people assert that libraries should not be logging, and as such efforts like this are pointless. Those people are welcome to convince the authors of the tens-of-thousands of libraries that DO write logs that they are all wrong. In the meantime, logr takes a more practical approach. Typical usage Somewhere, early in an application's life, it will make a decision about which logging library (implementation) it actually wants to use. Something like: Most apps will call into ot","default_branch":null,"files":null,"tree":[],"storefront":"/r/go-logr","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/go-logr/logr/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}