https://github.com/katzer/mruby-logger
A simple but sophisticated logging utility that you can use to output messages
https://github.com/katzer/mruby-logger
logger mruby-gem
Last synced: 5 months ago
JSON representation
A simple but sophisticated logging utility that you can use to output messages
- Host: GitHub
- URL: https://github.com/katzer/mruby-logger
- Owner: katzer
- License: mit
- Created: 2017-05-23T11:00:29.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2022-07-05T07:57:08.000Z (over 3 years ago)
- Last Synced: 2025-04-04T05:41:42.245Z (11 months ago)
- Topics: logger, mruby-gem
- Language: Ruby
- Size: 26.4 KB
- Stars: 7
- Watchers: 3
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# mruby-logger [](https://travis-ci.com/katzer/mruby-logger)
Implementation of the Ruby 2.4.1 Standard Library [Logger][logger].
A simple but sophisticated logging utility that you can use to output messages.
```ruby
logger = Logger.new 'logs/development.log'
logger.formatter = -> (severity, datetime, progname, msg) do
"[#{severity[0]}] #{datetime}: #{msg}\n"
end
logger.info 'hello world'
# => "[INFO] 2017-05-23 16:04:08 +0900: hello world"
```
## Installation
Add the line below to your `build_config.rb`:
```ruby
MRuby::Build.new do |conf|
# ... (snip) ...
conf.gem 'mruby-logger'
end
```
Or add this line to your aplication's `mrbgem.rake`:
```ruby
MRuby::Gem::Specification.new('your-mrbgem') do |spec|
# ... (snip) ...
spec.add_dependency 'mruby-logger'
end
```
## Development
Clone the repo:
$ git clone https://github.com/katzer/mruby-logger.git && cd mruby-logger/
Compile the source:
$ rake compile
Run the tests:
$ rake test
## Authors
- Sebastián Katzer, Fa. appPlant GmbH
## License
The mgem is available as open source under the terms of the [MIT License][license].
Made with :yum: in Leipzig
© 2017 [appPlant GmbH][appplant]
[logger]: https://ruby-doc.org/stdlib-2.4.1/libdoc/logger/rdoc/Logger.html
[license]: http://opensource.org/licenses/MIT
[appplant]: www.appplant.de