Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logger hash message #189

Merged
merged 2 commits into from
Jan 31, 2017
Merged

Logger hash message #189

merged 2 commits into from
Jan 31, 2017

Conversation

jodosha
Copy link
Member

@jodosha jodosha commented Jan 31, 2017

This proposal introduces a small change in the logger. When we pass a Hash, it should print all the key/value pairs instead of wrapping them into :message key.

Default logger

Before

logger.info(http: "HTTP/1.1", verb: "GET")

  # => [bookshelf] [INFO] [2017-01-31 14:40:13 +0100] {:http=>"HTTP/1.1", :verb=>"GET"}

After

logger.info(http: "HTTP/1.1", verb: "GET")

  # => [bookshelf] [INFO] [2017-01-31 14:40:51 +0100] HTTP/1.1 GET

JSON logger

Before

logger.info(http: "HTTP/1.1", verb: "GET")

  # => {"app":"bookshelf","severity":"INFO","time":"2017-01-31T13:36:18Z","message":{"http":"HTTP/1.1","verb":"GET"}}

After

logger.info(http: "HTTP/1.1", verb: "GET")

  # => {"app":"bookshelf","severity":"INFO","time":"2017-01-31T13:41:44Z","http":"HTTP/1.1","verb":"GET"}

/cc @AlfonsoUceda @hanami/issues @hanami/ecosystem for review 👍

@jodosha jodosha added this to the v1.0.0.beta1 milestone Jan 31, 2017
@jodosha jodosha self-assigned this Jan 31, 2017
@AlfonsoUceda
Copy link
Contributor

LGTM @jodosha 👍

@jodosha jodosha merged commit 1a1be2a into master Jan 31, 2017
@jodosha jodosha deleted the logger-hash-message branch January 31, 2017 14:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants