Skip to content
This repository has been archived by the owner on Nov 30, 2021. It is now read-only.

Commit

Permalink
fix(logger): remove priority from log messages
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Matthew Fisher committed Sep 3, 2014
1 parent 0c66ecd commit 0df66bd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions logger/syslog/message.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ type Message struct {
func (m *Message) String() string {
timeLayout := "2006-01-02 15:04:05"
return fmt.Sprintf(
"<%d>%s %s: %s",
m.Priority,
"%s %s: %s",
m.Time.Format(timeLayout),
m.Tag,
m.Content,
Expand Down
2 changes: 1 addition & 1 deletion logger/syslog/message_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ func TestMessageFormat(t *testing.T) {
m := &Message{time.Now(), 34, time.Now(), "localhost", "test", "hello world"}

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

0 comments on commit 0df66bd

Please sign in to comment.