diff options
Diffstat (limited to 'internal/log/syslog_test.go')
-rw-r--r-- | internal/log/syslog_test.go | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/internal/log/syslog_test.go b/internal/log/syslog_test.go index e7e82ec58..7432e61b3 100644 --- a/internal/log/syslog_test.go +++ b/internal/log/syslog_test.go @@ -71,6 +71,22 @@ func (suite *SyslogTestSuite) TestSyslog() { suite.Regexp(regexp.MustCompile(`timestamp=.* func=.* level=INFO msg="this is a test of the emergency broadcast system!"`), entry["content"]) } +func (suite *SyslogTestSuite) TestSyslogDisableTimestamp() { + // Get the current format. + timefmt := log.TimeFormat() + + // Set an empty timestamp. + log.SetTimeFormat("") + + // Set old timestamp on return. + defer log.SetTimeFormat(timefmt) + + log.Info(nil, "this is a test of the emergency broadcast system!") + + entry := <-suite.syslogChannel + suite.Regexp(regexp.MustCompile(`func=.* level=INFO msg="this is a test of the emergency broadcast system!"`), entry["content"]) +} + func (suite *SyslogTestSuite) TestSyslogLongMessage() { log.Warn(nil, longMessage) |