Make short work of your logs. https://git.jojodev.com/jolheiser/beaver
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
 
 
John Olheiser 0b1a1e4bd0 Time format (#5) 8 months ago
_examples Add extended and true colors (#3) 8 months ago
color Fix legacy code (#4) 8 months ago
.gitignore Initial commit 2 years ago
LICENSE Add extended and true colors (#3) 8 months ago
Makefile Add extended and true colors (#3) 8 months ago
README.md Add extended and true colors (#3) 8 months ago
console.go Initial commit 2 years ago
console_test.go Initial commit 2 years ago
console_windows.go Initial commit 2 years ago
go.mod Update import (#1) 2 years ago
go.sum Initial commit 2 years ago
level.go Time format (#5) 8 months ago
level_test.go Initial commit 2 years ago
logger.go Time format (#5) 8 months ago
logger_test.go Initial commit 2 years ago

README.md

beaver

Make short work of your logs

Loggers

Beaver comes ready to log to stdout via shorthand beaver.Info etc. usage.
However, Beaver can also create new standalone loggers with beaver.New.
Beaver loggers can write to anything implementing the io.Writer interface.

Options

Option Type Effect
TimePrefix boolean Prepends the date/time
StackPrefix boolean Prepends the calling file/line
StackLimit integer Amount of calling file to show, defaults to entire path
LevelPrefix boolean Prepends a logging level prefix, e.g. [T] for Trace
LevelColor boolean Colors the LevelPrefix if enabled
MessageColor boolean Colors the message itself

The default Console configuration is below
Colored messages convey the logging level while reducing the amount of space used for CLI applications

Option Value
TimePrefix false
StackPrefix false
StackLimit 0
LevelPrefix false
LevelColor false
MessageColor true

Colors

Beaver allows you to customize the colors of various parts of the message

color. Default Format
Trace Bold, FgCyan
Debug Bold, FgBlue
Info Bold, FgGreen
Warn Bold, FgYellow
Error Bold, FgRed
Fatal Bold, BgRed
Default None
Time Default
Stack Default
// Set Trace logging to Magenta instead of Bold-Cyan
color.Trace = color.New(color.FgMagenta)

More info for the color package

LICENSE

MIT