Popularity
7.4
Growing
Activity
0.0
Stable
291
230
31
Programming language: Go
License: Mozilla Public License 2.0
Tags:
Logging
Latest version: v1.0.0
logutils alternatives and similar packages
Based on the "Logging" category.
Alternatively, view logutils alternatives based on common mentions on social networks and blogs.
-
loggo
A logging library for Go. Doesn't use the built in go log standard library, but instead offers a replacement. -
httpretty
Pretty-prints your regular HTTP requests on your terminal for debugging (similar to http.DumpRequest). -
rollingwriter
RollingWriter is an auto-rotate io.Writer implementation with multi policies to provide log file rotation. -
ozzo-log
High performance logging supporting log severity, categorization, and filtering. Can send filtered log messages to various targets (e.g. console, network, mail). -
logur
An opinionated logger interface and collection of logging best practices with adapters and integrations for well-known libraries (logrus, go-kit log, zap, zerolog, etc). -
gologger
Simple easy to use log lib for go, logs in Colored Cosole, Simple Console, File or Elasticsearch. -
stdlog
Stdlog is an object-oriented library providing leveled logging. It is very useful for cron jobs. -
mlog
A simple logging module for go, with 5 levels, an optional rotating logfile feature and stdout/stderr output. -
go-cronowriter
A simple writer that rotate log files automatically based on current date and time, like cronolog. -
gomol
Gomol is a library for structured, multiple-output logging for Go with extensible logging outputs
Get performance insights in less than 4 minutes
Scout APM uses tracing logic that ties bottlenecks to source code so you know the exact line of code causing performance issues and can get back to building a great product faster.
Sponsored
scoutapm.com
Do you think we are missing an alternative of logutils or a related project?
Popular Comparisons
README
logutils
logutils is a Go package that augments the standard library "log" package to make logging a bit more modern, without fragmenting the Go ecosystem with new logging packages.
The simplest thing that could possibly work
Presumably your application already uses the default log
package. To switch, you'll want your code to look like the following:
package main
import (
"log"
"os"
"github.com/hashicorp/logutils"
)
func main() {
filter := &logutils.LevelFilter{
Levels: []logutils.LogLevel{"DEBUG", "WARN", "ERROR"},
MinLevel: logutils.LogLevel("WARN"),
Writer: os.Stderr,
}
log.SetOutput(filter)
log.Print("[DEBUG] Debugging") // this will not print
log.Print("[WARN] Warning") // this will
log.Print("[ERROR] Erring") // and so will this
log.Print("Message I haven't updated") // and so will this
}
This logs to standard error exactly like go's standard logger. Any log messages you haven't converted to have a level will continue to print as before.