diff options
author | Yawning Angel <yawning@torproject.org> | 2014-09-03 11:55:16 +0000 |
---|---|---|
committer | Yawning Angel <yawning@torproject.org> | 2014-09-03 11:55:16 +0000 |
commit | fb13cf124149ebb94f400f718c9ae22dda341bdd (patch) | |
tree | 3d56a52929c8bdad7b68bff14c5c0ac88eb6455a /obfs4proxy/log.go | |
parent | 79e94103d6bf7685c78e991f0d1b93b0eecefa3d (diff) |
Add a prolog/epilog to the logging that always gets logged.
The prolog prints the version as soon as logging is enabled, but before
the pluggable transport configuration is done. The epilog is printed as
the code returns from main, as long as either client or server pt
configuration succeded.
Diffstat (limited to 'obfs4proxy/log.go')
-rw-r--r-- | obfs4proxy/log.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/obfs4proxy/log.go b/obfs4proxy/log.go index 22f345c..5440596 100644 --- a/obfs4proxy/log.go +++ b/obfs4proxy/log.go @@ -41,6 +41,13 @@ const ( var logLevel = levelInfo +func noticef(format string, a ...interface{}) { + if enableLogging { + msg := fmt.Sprintf(format, a...) + log.Print("[NOTICE]: " + msg) + } +} + func errorf(format string, a ...interface{}) { if enableLogging && logLevel >= levelError { msg := fmt.Sprintf(format, a...) |