Logger2r
Wrapper class for rubby Logger. Allow to initialize the Logger class for specific progname, and configure it based on yaml config. Inspired by Log4r's yamlconfigurator.
Installation
Add this line to your application's Gemfile:
gem 'logger2r'
And then execute:
$ bundle
Or install it yourself as:
$ gem install logger2r
Usage
Prepare yaml config file:
---
:logger2r_config:
:default:
:severity_level: :info
:device: "stdout"
:MyClass:
:severity_level: :warn
:datetime_format: "%y-%m-%d"
require "logger2r"
Logger2r.config_file = ...my_yaml_file...
class MyClass
def initialize
@logger = Logger2r.for_class(self.class.name)
end
def foo
@logger.error "AAAA"
end
end
Versioning
See semver.org
Contributing
- Fork it
- 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 new Pull Request