Documentation ¶
Overview ¶
Package logging provides custom gokit logger implementation(s).
Brief ¶
This library provides custom gokit logger implementation(s), currently it provides JSON formatted stdout & stderr sync. implementation.
Usage
$ go get -u github.com/adzr/logging
Then, import the package:
import ( "github.com/adzr/logging" )
Example
logger := logging.CreateStdSyncLogger("mylogger", logging.DefaultLoggingConfiguration()) logger.Log("key", "value")
Index ¶
Constants ¶
View Source
const ( // DefaultFormat is the default logging output format. DefaultFormat = "json" // DefaultLevel is the default logging severity level. DefaultLevel = "info" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct { // Format is the logging output format, it can be only 'json' for now, any other value will be ignored. Format string `json:"format"` // Level is the logging severity level allowed, it can be 'none', 'error', 'warn', 'info', 'debug'. // If set to 'none' no logs will appear. Level string `json:"level"` }
Config carries service logging configuration.
func Configuration ¶
func Configuration() *Config
Configuration returns a new instance of the default configurations for logging.
Click to show internal directories.
Click to hide internal directories.