logcr
Version, currently 0.1.11 version
- 0.1.1latestAug 10, 2020
github.com/OisinA/logcr
A simple structured logging library for Crystal. Supports either readable output or JSON.
1 stars
0 dependents
License: MIT
Installation
# Add this to your shard.yml
dependencies:
logcr:
github: OisinA/logcr
version: ~> 0.1.1Then run:
shards installshard.yml
- Crystal
0.34.0- License
- MIT
- Author
- OisinA
Dependencies
This version declares no dependencies.
README
LogCR
A simple structured logging library for Crystal. Supports either readable output or JSON.
Usage
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
Different Log Levels
LogCR::Logger.new("test", :debug, :simple)
LogCR::Logger.new("test", :info, :simple)
LogCR::Logger.new("test", :warn, :simple)
LogCR::Logger.new("test", :error, :simple)
JSON Output
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"}
Contributing
- 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
Contributors
- OisinA - 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
0.1.1- Tagged
- Aug 10, 2020
- Commit
561bf4be3ec8- Crystal
0.34.0- Indexed
- yes
Dependents
No indexed shard depends on this one yet.
Repository
github.com/OisinA/logcr
Metadata
- Created
- Aug 12, 2026
- Updated
- Aug 15, 2026
- Synced
- Aug 13, 2026
- Versions
- 1