After I began utilizing Go, I used to be dissatisfied to search out that its logging services lack options that I’ve come to anticipate from trendy languages and their customary libraries. The log package deal is so primary that one would possibly as nicely simply use Println. The slog package deal is closely geared for machine-parsed logs, which could be nice for high-volume enterprisey tasks, however it has no help for the normal formatting, highlighting, or filtering that work nicely for native customers and admins.
I wrote loq to handle these shortcomings.
It’s constructed with slog’s interfaces and semantics, for compatibility, however is designed to make logging simpler for human builders and customers, particularly in stand-alone software program.
Right here’s an excerpt from the readme, which supplies a tour of the principle options:
Highlights:
-
Uncluttered line-oriented output
-
Printf-style message formatting
-
Coloration coding by severity stage
-
Named severity ranges past these outlined by slog
-
Handler timber with inheritable severity ranges
The handlers and wrappers in loq are interchangeable components that can be utilized with one another, mixed with slog sorts, or handed to code that accepts slog sorts. In lots of instances, they’re additionally sooner than what slog affords.
The one dependencies are from Go’s customary library and X-Repositories.

