Documentation ¶
Index ¶
- Constants
- Variables
- func AddAdapter(name string, adapter AdapterPod)
- func Debugf(msg ...interface{})
- func Debugln(msg ...interface{})
- func DefaultAdapter(m MsgType, o OutType, config map[string]interface{}, msg ...interface{})
- func Errorf(msg ...interface{})
- func Errorln(msg ...interface{})
- func Fatal(msg ...interface{})
- func HTTPError(w http.ResponseWriter, code int)
- func Printf(msg ...interface{})
- func Println(msg ...interface{})
- func RemoveAdapter(name string)
- func SetAdapterConfig(name string, config map[string]interface{})
- func Warningf(msg ...interface{})
- func Warningln(msg ...interface{})
- type AdapterFunc
- type AdapterPod
- type MsgType
- type OutType
Constants ¶
Variables ¶
var ( // DebugMode Enable debug mode DebugMode bool // EnableANSIColors enables ANSI colors, default true EnableANSIColors = true // MaxLineSize limits the size of the line, if the size // exceeds that indicated by MaxLineSize the system cuts // the string and adds "..." at the end. MaxLineSize = DefaultMaxLineSize // TimeFormat defines which pattern will be applied for // display time in the logs. TimeFormat = DefaultTimeFormat // Colors contain color array Colors = []string{ MessageLog: "\x1b[37m", Message2Log: "\x1b[92m", WarningLog: "\x1b[93m", DebugLog: "\x1b[96m", ErrorLog: "\x1b[91m", } // Prefixes of messages Prefixes = []string{ MessageLog: "msg", Message2Log: "msg", WarningLog: "warning", DebugLog: "debug", ErrorLog: "error", } )
Functions ¶
func AddAdapter ¶
func AddAdapter(name string, adapter AdapterPod)
AddAdapter allows to add an adapter and parameters
func Debugf ¶
func Debugf(msg ...interface{})
Debugf shows debug message on stdout without line break at the end. If debug mode is not active no message is displayed
func Debugln ¶
func Debugln(msg ...interface{})
Debugln shows debug message on stdout with line break at the end. If debug mode is not active no message is displayed
func DefaultAdapter ¶
DefaultAdapter of log package
func Errorf ¶
func Errorf(msg ...interface{})
Errorf shows formatted error message on stdout without line break at the end.
func Fatal ¶
func Fatal(msg ...interface{})
Fatal show message with line break at the end and exit to OS.
func HTTPError ¶
func HTTPError(w http.ResponseWriter, code int)
HTTPError write lot to stdout and return json error on http.ResponseWriter with http error code.
func Printf ¶
func Printf(msg ...interface{})
Printf shows formatted message on stdout without line break at the end.
func Println ¶
func Println(msg ...interface{})
Println shows message on stdout with line break at the end.
func SetAdapterConfig ¶
SetAdapterConfig allows set new adapter parameters
Types ¶
type AdapterFunc ¶
AdapterFunc is the type for the function adapter any function that has this signature can be used as an adapter
type AdapterPod ¶
type AdapterPod struct { Adapter AdapterFunc Config map[string]interface{} }
AdapterPod contains the metadata of an adapter