1
0
mirror of https://github.com/gilbertchen/duplicacy synced 2025-12-11 13:53:16 +00:00

Allow logging function to be customized

This commit is contained in:
Gilbert Chen
2017-08-23 22:33:45 -04:00
parent 799b040913
commit f69550d0db

View File

@@ -23,6 +23,7 @@ const (
ASSERT = 4
)
var LogFunction func(level int, logID string, message string)
var printLogHeader = false
@@ -117,6 +118,11 @@ func logf(level int, logID string, format string, v ...interface{}) {
message := fmt.Sprintf(format, v...)
if LogFunction != nil {
LogFunction(level, logID, message)
return
}
now := time.Now()
// Uncomment this line to enable unbufferred logging for tests