Skip to content

Commit 0df66bd

Browse files
author
Matthew Fisher
committed
fix(logger): remove priority from log messages
Our current log message follows this format: 2014-09-02 09:40:00 deis[api]: message Where `deis[api]` is the tag. Removing the priority keeps the log message the same format as before.
1 parent 0c66ecd commit 0df66bd

2 files changed

Lines changed: 2 additions & 3 deletions

File tree

logger/syslog/message.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ type Message struct {
2121
func (m *Message) String() string {
2222
timeLayout := "2006-01-02 15:04:05"
2323
return fmt.Sprintf(
24-
"<%d>%s %s: %s",
25-
m.Priority,
24+
"%s %s: %s",
2625
m.Time.Format(timeLayout),
2726
m.Tag,
2827
m.Content,

logger/syslog/message_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ func TestMessageFormat(t *testing.T) {
99
m := &Message{time.Now(), 34, time.Now(), "localhost", "test", "hello world"}
1010

1111
timeLayout := "2006-01-02 15:04:05"
12-
expectedOutput := "<34>" + m.Time.Format(timeLayout) + " test: hello world"
12+
expectedOutput := m.Time.Format(timeLayout) + " test: hello world"
1313
if m.String() != expectedOutput {
1414
t.Errorf("expected '" + expectedOutput + "', got '" + m.String() + "'.")
1515
}

0 commit comments

Comments
 (0)