Categories: None [Edit]
fancy_logger
# Fancy Logger
An easily customizable logger with style.
## Install
### Bundler: `gem 'fancy_logger'`
### RubyGems: `gem install fancy_logger`
## Usage
Simply use as if you were using the normal Ruby `Logger` class:
```ruby
require 'fancy_logger'
logger = FancyLogger.new(STDOUT)
logger.info "Hello"
```
### Config
The `config` instance method allows you to modify the configuration of the Logger within a DSL.
Continuing with our last example:
```ruby
logger.config do
timestamp_format "%c"
styles do
info do
foreground :yellow
blink true
end
end
end
logger.debug 'Look here!'
logger.info 'Doing things...'
logger.warn 'Watch out!'
logger.error 'Bad'
logger.fatal 'VERY bad'
logger.unknown 'Weird unknown stuff'
```
#### Output
![][output_example]
### Config
```ruby
# The format of the timestamp in the log. Follows the strftime standards.
timestamp_format "%F %r"
# On the first logged message, FancyLogger will prepend a help message
# containing a list of all the severities (debug, info, warn, etc) styled
# according to your config as reference.
# You can disable this by setting the below option to false.
show_help_message true
# Under styles, you have a configuration for each severity.
# Each severity has a configuration with the following valid options:
# Key: foreground
# Value:
# :default, :black, :red, :green, :yellow, :blue, :magenta, :cyan, :white
#
# Key: background
# Value:
# :default, :black, :red, :green, :yellow, :blue, :magenta, :cyan, :white
#
# Key: reset
# Value: true or false
#
# Key: bright
# Value: true or false
#
# Key: italic
# Value: true or false
#
# Key: underline
# Value: true or false
#
# Key:
# blink
# Value: true or false
#
# Key: inverse
# Value: true or false
#
# Key: hide
# Value: true or false
styles do
debug do
foreground :black
background :cyan
end
info do
foreground :default
background :default
end
warn do
foreground :yel...
Total
Ranking: 73,415 of 180,507
Downloads: 11,224
Daily
Ranking: 50,030 of 180,487
Downloads: 9
Downloads Trends
Ranking Trends
Num of Versions Trends
Popular Versions (Major)
Popular Versions (Major.Minor)
Depended by
Rank | Downloads | Name |
---|---|---|
4,912 | 1,049,074 | jquery-cookie-rails |
80,395 | 9,786 | morris-rails |
Depends on
Rank | Downloads | Name |
---|---|---|
16 | 855,753,735 | rake |
64 | 422,592,546 | rainbow |
83 | 348,060,549 | rb-fsevent |
378 | 85,525,877 | redcarpet |
388 | 83,133,225 | guard-rspec |
715 | 52,342,960 | fuubar |
1,045 | 29,836,203 | github-markup |
3,953 | 1,736,717 | version |
6,826 | 477,756 | guard-yard |
36,873 | 28,495 | outline |
39,220 | 26,319 | at |
Owners
# | Gravatar | Handle |
---|---|---|
1 | RyanScottLewis |