# class Camping::Firewatch

### Public Class Methods

default_logger() click to toggle source

    # File lib/gear/firewatch.rb, line 19
    def default_logger
      Dry.Logger(:Camping, template: default_template).add_backend(stream: "logs/development.log")
    end

default_template() click to toggle source

    # File lib/gear/firewatch.rb, line 22
    def default_template
      "[<green>%<severity>s</green> - %<time>s] %<message>s"
    end

logger() click to toggle source

    # File lib/gear/firewatch.rb, line 13
    def logger
      @logger ||= default_logger
    end

logger=(new_logger) click to toggle source

    # File lib/gear/firewatch.rb, line 16
    def logger=(new_logger)
      @logger = new_logger
    end

new(app, logger = nil) click to toggle source

`logger` can be any object that supports the `write` or +<<+ methods, which includes the standard library Logger. These methods are called with a single string argument, the log message. If `logger` is nil, Firewatch(CommonLogger) will fall back `env['rack.errors']`.

    # File lib/gear/firewatch.rb, line 31
    def initialize(app, logger = nil)
      @app = app
      if logger == nil
        @logger = Camping::Firewatch.default_logger
      else
        @logger = logger
      end
      # @logger = Camping::Firewatch.logger = logger.nil? ? Camping::Firewatch.default_logger : logger
    end