/logwrap

Abstraction for syslog-style filterable prioritized string log messages

Primary LanguageGoApache License 2.0Apache-2.0

logwrap

License Go Doc Go Report Card Build Status Coverage Status

Package logwrap provides a very basic logging abstraction supporting syslog-style filterable prioritized text messages. The underlying log implementation is injected by providing a wrapper object that implements Logger. Logger instances can be created for specific objects or roles, and can specify an identifier for themselves.

Where the underlying log infrastructure is not safe for concurrent use, MakeChanLogger allows multiple goroutines to send messages through a channel to a goroutine that exclusively uses the logger.

The use case is helper packages that should emit log messages with the same tool as the application itself.