aboutsummaryrefslogtreecommitdiff
path: root/std.go
blob: cf70e51b70f04824c21e740a789a39597f16efcf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package logger

import (
	"src.userspace.com.au/logger/message"
)

var std *Logger

func init() {
	std, _ = New()
}

// Info logs an information message.
func Info(args ...interface{}) { std.Info(args...) }

// Debug logs a debug message.
func Debug(args ...interface{}) { std.Debug(args...) }

// IsDebug determines the debug status for a logger instance.
// Use this to conditionally execute blocks of code depending on the log verbosity.
func IsDebug() bool { return std.IsDebug() }

// Field enables changing the default fields for a logger instance.
func Field(k string, v interface{}) *Logger { return std.Field(k, v) }

// Named creates a new instance of a logger with a new name.
func Named(n string) *Logger { return std.Named(n) }

// SetWriter sets the writer for the default logger.
func SetWriter(w message.Writer) { std.writers = []message.Writer{w} }