{"repo":"elgopher/yala","free":true,"listed":false,"github":"https://github.com/elgopher/yala","clone":"git clone https://github.com/elgopher/yala.git","description":"Tiny structured logging abstraction or facade for various logging libraries, allowing the end user to plug in the desired logging library in main.go.","language":"Go","stars":14,"topics":["logging","logger","logrus","zap","glog","zerolog","log","context","log15","fmt"],"license":"MIT","category":"analytics","readme_excerpt":"YALA - Yet Another Logging Abstraction for Go Tiny structured logging abstraction or facade for various logging libraries, allowing the end user to plug in the desired logging library in main.go . Supported logging libraries (via adapters) logrus, zap, zerolog, glog, log15, standard log and console When to use? If you are a package/module/library author And you want to participate in the end user logging system (log messages using the logger provided by the end user) You don't want to add dependency to any specific logging library to your code You don't want to manually inject logger to every possible place where you want to log something (such as function, struct etc.) If you need a nice and elegant API with a bunch of useful functions, but at the same time you don't want your end users to spend hours on writing their own logging adapter. Installation Please note that at least Go 1.19 is required. How to use Choose logger - global or normal? Global logger can be accessed from everywhere in your package and can be reconfigured anytime. Normal logger is an immutable logger, initialized only once. Use global logger Specify adapter - a real logger implementation. Why context.Context is a parameter? context.Context can very useful in transiting request-scoped tags or even entire logger. A logger.Adapter implementation might use them making possible to log messages instrumented with tags. Thanks to that your library can trully participate in the incoming request. Use normal logger","default_branch":null,"files":null,"tree":[],"storefront":"/r/elgopher","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/elgopher/yala/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."}