log-json_formatter
Version, currently 2.0.12 versions
- 2.0.1latestOct 6, 2022
- 2.0.0not indexedOct 6, 2022
github.com/dscottboggs/log-json_formatter
(Crystal) A formatter for JSON-encoded logs to an IO
0 stars
0 dependents
License: MPL
Installation
# Add this to your shard.yml
dependencies:
log-json_formatter:
github: dscottboggs/log-json_formatter
version: ~> 2.0.1Then run:
shards installshard.yml
- Crystal
1.5.1- License
- MPL
- Author
- D. Scott Boggs
Dependencies
This version declares no dependencies.
README
log-json_formatter
A Log::Formatter for JSON-encoded logs to an IO
Installation
-
Add the dependency to your
shard.yml:dependencies: log-json_formatter: github: dscottboggs/log-json_formatter -
Run
shards install
Usage
require "log-json_formatter"
record CustomType, a = 1, b = 2 do
include ::Log::JSONFormatter::Loggable
def_to_metadata_value({a: @a, b: @b})
end
::Log.setup level: :trace,
backend: Log::IOBackend.new formatter: Log::JSONFormatter,
Log.info &.emit "example message", metadata: 1, values: %w[of any kind],
"even values of a": CustomType.new
Contributing
- Fork it (https://github.com/dscottboggs/log-json_formatter/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
Contributors
- D. Scott Boggs - creator and maintainer
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This release
- Version
2.0.1- Tagged
- Oct 6, 2022
- Commit
c2da1459e7ce- Crystal
1.5.1- Indexed
- yes
Dependents
No indexed shard depends on this one yet.
Repository
github.com/dscottboggs/log-json_formatter
Metadata
- Created
- Aug 12, 2026
- Updated
- Aug 15, 2026
- Synced
- Aug 15, 2026
- Versions
- 2