Module: Logsly

Defined in:
lib/logsly/colors.rb,
lib/logsly.rb,
lib/logsly/version.rb,
lib/logsly/base_output.rb,
lib/logsly/file_output.rb,
lib/logsly/stdout_output.rb,
lib/logsly/syslog_output.rb

Overview

This class provides a DSL for setting color scheme values and lazy eval’s the DSL to generate a Logging color scheme object. See github.com/TwP/logging/blob/master/lib/logging/color_scheme.rb for details on Logging color schemes.

Defined Under Namespace

Modules: LoggerMethods, Settings Classes: BaseOutput, BaseOutputData, Colors, ColorsData, FileOutput, FileOutputData, NullColors, NullOutput, StdoutOutput, SyslogOutput, SyslogOutputData

Constant Summary collapse

VERSION =
"1.1.0"

Class Method Summary collapse

Class Method Details

.colors(name, &block) ⇒ Object



28
29
30
31
32
# File 'lib/logsly.rb', line 28

def self.colors(name, &block)
  require 'logsly/colors'
  Settings.colors[name.to_s] = Colors.new(name, &block) if !block.nil?
  Settings.colors[name.to_s]
end

.file(name, &block) ⇒ Object



39
40
41
42
# File 'lib/logsly.rb', line 39

def self.file(name, &block)
  require 'logsly/file_output'
  Settings.outputs[name.to_s] = FileOutput.new(&block)
end

.included(receiver) ⇒ Object



9
10
11
12
13
14
# File 'lib/logsly.rb', line 9

def self.included(receiver)
  receiver.class_eval do
    attr_reader :log_type, :level, :outputs, :logger
    include LoggerMethods
  end
end

.outputs(name) ⇒ Object



49
50
51
# File 'lib/logsly.rb', line 49

def self.outputs(name)
  Settings.outputs[name.to_s]
end

.resetObject



23
24
25
26
# File 'lib/logsly.rb', line 23

def self.reset
  Settings.reset
  Logging.reset
end

.stdout(name, &block) ⇒ Object



34
35
36
37
# File 'lib/logsly.rb', line 34

def self.stdout(name, &block)
  require 'logsly/stdout_output'
  Settings.outputs[name.to_s] = StdoutOutput.new(&block)
end

.syslog(name, &block) ⇒ Object



44
45
46
47
# File 'lib/logsly.rb', line 44

def self.syslog(name, &block)
  require 'logsly/syslog_output'
  Settings.outputs[name.to_s] = SyslogOutput.new(&block)
end