Discover Packages
github.com/finiteloopme/goutils
pkg
log
package
Version:
v0.0.0-...-4dca428
Opens a new window with list of versions in this module.
Published: Jul 18, 2024
License: Apache-2.0
Opens a new window with license information.
Imports: 2
Opens a new window with list of imports.
Imported by: 14
Opens a new window with list of known importers.
Documentation
Documentation
¶
A simple log utility.
Supports following two log formats. Set environment variable `LOG_FORMAT` to the corresponding value:
1. json
2. text
Text format is the default
View Source
const (
LogFormatDefault = "text"
LogFormatJSON = "json"
)
Constants for log format
Log at Fatal level. Sequence is:
1. Log the actual error
2. Exit with code 1
Log at WARN level. Logs the err message first followed by the whole error
Implementing pkg/log/Logger interface
func (logger Logger ) Debugf(format string , args ...interface{})
func (logger Logger ) Errorf(format string , args ...interface{})
func (logger Logger ) Infof(format string , args ...interface{})
func (logger Logger ) Warnf(format string , args ...interface{})
Source Files
¶
Click to show internal directories.
Click to hide internal directories.