Created
April 2, 2012 06:29
-
-
Save wwood/2281237 to your computer and use it in GitHub Desktop.
default_bio_logger_log_level_tester.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'bio-logger' | |
if __FILE__ == $0 | |
require 'optparse' | |
# Parse cmd line options | |
o = OptionParser.new do |opts| | |
opts.banner = "gag [options] <pileup_output>" | |
opts.on("--logger filename",String,"Log to file (default STDOUT)") do | name | | |
Bio::Log::CLI.logger(name) | |
end | |
opts.on("--trace options",String,"Set log level (default INFO, see bio-logger documentation at https://github.com/pjotrp/bioruby-logger-plugin") do | s | | |
Bio::Log::CLI.trace(s) | |
end | |
opts.on("-q", "--quiet", "Run quietly") do |q| | |
Bio::Log::CLI.trace('error') | |
end | |
opts.on("-v", "--verbose", "Run verbosely") do |v| | |
Bio::Log::CLI.trace('info') | |
end | |
end.parse! | |
log = Bio::Log::LoggerPlus.new 'mylag' | |
Bio::Log::CLI.configure('mylag') | |
log.debug 'debugd' | |
log.info 'infod' | |
log.warn 'warnd' | |
log.error 'roar' | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment