summaryrefslogtreecommitdiffhomepage
path: root/src/main.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/main.go
parentcba1d6585ab9b12ae3e0897db85675ba452c3f09 (diff)
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/main.go')
-rw-r--r--src/main.go16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/main.go b/src/main.go
index dde21fb..196a4c6 100644
--- a/src/main.go
+++ b/src/main.go
@@ -65,9 +65,23 @@ func main() {
return
}
+ // get log level (default: info)
+
+ logLevel := func() int {
+ switch os.Getenv("LOG_LEVEL") {
+ case "debug":
+ return LogLevelDebug
+ case "info":
+ return LogLevelInfo
+ case "error":
+ return LogLevelError
+ }
+ return LogLevelInfo
+ }()
+
// create wireguard device
- device := NewDevice(tun, LogLevelDebug)
+ device := NewDevice(tun, logLevel)
logInfo := device.log.Info
logError := device.log.Error