No release in over 3 years
Low commit activity in last 3 years
A simple single-line formatter for Ougai logs.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.15
~> 10.0
~> 3.0

Runtime

~> 1.5
 Project Readme

Ougai::Formatters::InlineReadable

Ougai is an amazing structured logger for Ruby. But its Readable formatter, best used in development, is a little annoying because it spams out additional structured data onto many lines. Ougai::Formatters::InlineReadable instead uses #inspect to put your structured data on a single line.

Usage

require 'ougai'
require 'ougai/formatters/inline_readable'

logger = Ougai::Logger.new($stderr)
logger.formatter = Ougai::Formatters::InlineReadable.new

logger.info "This is a test message."
logger.debug msg: "This is a message with structured data.", foo: 5, bar: 10

And example output:

[2017-09-20T14:36:36.624-04:00] INFO: This is a test message. ({})
[2017-09-20T14:36:37.294-04:00] DEBUG: This is a message with structured data. ({:foo=>5, :bar=>10})