aboutsummaryrefslogtreecommitdiffstats
path: root/src/logger.go
diff options
context:
space:
mode:
authorMathias Hall-Andersen <mathias@hall-andersen.dk>2017-08-11 16:18:20 +0200
committerMathias Hall-Andersen <mathias@hall-andersen.dk>2017-08-11 16:18:20 +0200
commita4eff12d7f749c992247579161c4ce9e60e2df47 (patch)
tree6032dd0a96ced8313d7199e569ab657f3ba91ca7 /src/logger.go
parentNumber of fixes in response to code review (diff)
downloadwireguard-go-a4eff12d7f749c992247579161c4ce9e60e2df47.tar.xz
wireguard-go-a4eff12d7f749c992247579161c4ce9e60e2df47.zip
Improved receive.go
- Fixed configuration listen-port semantics - Improved receive.go code for updating listen port - Updated under load detection, how follows the kernel space implementation - Fixed trie bug accidentally introduced in last commit - Added interface name to log (format still subject to change) - Can now configure the logging level using the LOG_LEVEL variable - Begin porting netsh.sh tests - A number of smaller changes
Diffstat (limited to 'src/logger.go')
-rw-r--r--src/logger.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/logger.go b/src/logger.go
index 9fe73b4..0872ef9 100644
--- a/src/logger.go
+++ b/src/logger.go
@@ -19,7 +19,7 @@ type Logger struct {
Error *log.Logger
}
-func NewLogger(level int) *Logger {
+func NewLogger(level int, prepend string) *Logger {
output := os.Stdout
logger := new(Logger)
@@ -34,16 +34,16 @@ func NewLogger(level int) *Logger {
}()
logger.Debug = log.New(logDebug,
- "DEBUG: ",
+ "DEBUG: "+prepend,
log.Ldate|log.Ltime|log.Lshortfile,
)
logger.Info = log.New(logInfo,
- "INFO: ",
+ "INFO: "+prepend,
log.Ldate|log.Ltime,
)
logger.Error = log.New(logErr,
- "ERROR: ",
+ "ERROR: "+prepend,
log.Ldate|log.Ltime,
)
return logger