Documentation ¶
Index ¶
- func Critical(tags []string, message string, data interface{})
- func Debug(tags []string, message string, data interface{})
- func Error(tags []string, message string, data interface{})
- func Fatal(tags []string, message string, data interface{})
- func Info(tags []string, message string, data interface{})
- func Init(o Options) error
- func Warning(tags []string, message string, data interface{})
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Critical ¶
Critical creates a log for critical error messages. Is synchronous and if you need concurrency run it as a goroutine.
func Debug ¶
Debug creates a log for debug messages. Is synchronous and if you need concurrency run it as a goroutine.
func Error ¶
Error creates a log for error messages. Is synchronous and if you need concurrency run it as a goroutine.
func Fatal ¶
Fatal creates a log for critical error messages and shuts down the server. Is synchronous and should not be ran concurrently as it would defeat the purpose of being a fatal action.
Types ¶
type Options ¶
type Options struct { Host string `json:"host"` // When omitting, logs will be written locally System string `json:"system"` // Required Token string `json:"token"` // Required if Host is set Local bool `json:"local"` // Default false - If you want to force local logs in addition to the remote ones Timeout int `json:"timeout"` // Default 10 - How long communication with server is allowed to take before giving up and writing a local log }
Options is the config that is used for bootstrapping the logger. Default is posting logs to remote server but omitting host will write local logs instead.