Module: Berkshelf::API::Logging
- Included in:
- Application, CacheBuilder, CacheBuilder::Worker::Base, CacheBuilder::Worker::FileStore, CacheBuilder::Worker::Github, CacheManager, DependencyCache, RESTGateway, SiteConnector::Supermarket
- Defined in:
- lib/berkshelf/api/logging.rb
Class Attribute Summary collapse
Class Method Summary collapse
Instance Method Summary collapse
- #logger ⇒ Logger (also: #log)
Class Attribute Details
.logger ⇒ Logger
5 6 7 |
# File 'lib/berkshelf/api/logging.rb', line 5 def logger @logger end |
Class Method Details
.init(options = {}) ⇒ Logger
17 18 19 20 21 22 23 24 25 26 |
# File 'lib/berkshelf/api/logging.rb', line 17 def init( = {}) level = [:level] || "INFO" location = [:location] || STDOUT formatter = [:formatter] || nil Celluloid.logger = @logger = Logger.new(location).tap do |log| log.level = Logger::Severity.const_get(level.upcase) log.formatter = formatter if formatter end end |