]> Cypherpunks.ru repositories - govpn.git/blobdiff - src/cypherpunks.ru/govpn/logger.go
Raise copyright years
[govpn.git] / src / cypherpunks.ru / govpn / logger.go
index f646338a037c0a2cb7fe271ca6f5857d5b8ebac3..48a32356d928b6f07ba461628c868bee90f437d8 100644 (file)
@@ -1,6 +1,6 @@
 /*
 GoVPN -- simple secure free software virtual private network daemon
-Copyright (C) 2014-2016 Sergey Matveev <stargrave@stargrave.org>
+Copyright (C) 2014-2017 Sergey Matveev <stargrave@stargrave.org>
 
 This program is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
@@ -36,12 +36,20 @@ func SyslogEnable() {
        }
 }
 
-// Call either syslog-related logger.Println if SyslogEnabled,
-// default log.Println otherwise.
-func Println(v ...interface{}) {
+// Call either syslog-related logger.Printf if SyslogEnabled,
+// default log.Printf otherwise.
+func Printf(f string, v ...interface{}) {
        if sysloger == nil {
-               log.Println(v...)
+               log.Printf(f, v...)
        } else {
-               sysloger.Println(v...)
+               sysloger.Printf(f, v...)
+       }
+}
+
+// Call both default log.Printf and syslog-related one.
+func BothPrintf(f string, v ...interface{}) {
+       log.Printf(f, v...)
+       if sysloger != nil {
+               sysloger.Printf(f, v...)
        }
 }