-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathlogger.go
More file actions
28 lines (23 loc) · 771 Bytes
/
Copy pathlogger.go
File metadata and controls
28 lines (23 loc) · 771 Bytes
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
package ggpo
import (
"log"
"os"
"github.com/assemblaj/ggpo/internal/util"
)
// SetLogger sets the log.Logger used when printing log messages. Use this
// method for more precise control over the logging output and format. Use
// EnableLogs and DisableLogs for simple logging to os.Stdout. Log messages
// are not printed by default.
func SetLogger(l *log.Logger) {
util.Log = l
}
// EnableLogs enables printing log messages to os.Stdout. Use SetLogger for
// more precise control over the logging output and format. Log messages are
// not printed by default.
func EnableLogs() {
SetLogger(log.New(os.Stdout, "GGPO ", log.Ldate|log.Ltime|log.Lmsgprefix))
}
// DisableLogs disables printing log messages.
func DisableLogs() {
SetLogger(util.DiscardLogger())
}