A simple structured logging library for Crystal. Supports either readable output or JSON.
logger = LogCR::Logger.new("test", :info, :simple)
logger.with_fields({"key"=>"value"}).info("out")
2020-08-10 22:33:19 +01:00 [test] [INFO] out
key => value
LogCR::Logger.new("test", :debug, :simple)
LogCR::Logger.new("test", :info, :simple)
LogCR::Logger.new("test", :warn, :simple)
LogCR::Logger.new("test", :error, :simple)
logger = LogCR::Logger.new("test", :info, :json)
logger.with_fields({"key"=>"value"}).info("out")
{"msg":"out","_level":"info","_line":"7","_file":"/home/Projects/logcr/spec/logcr_spec.cr","key":"value"}
- Fork it (https://github.com/OisinA/logcr/fork)
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request
- OisinA - creator and maintainer