Module: Logsly

Includes:
MuchPlugin
Defined in:
lib/logsly/colors.rb,
lib/logsly.rb,
lib/logsly/outputs.rb,
lib/logsly/version.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/logging-1.8.2/lib/logging/color_scheme.rb for details on Logging color schemes.

Defined Under Namespace

Modules: InstanceMethods, Logging182, Outputs Classes: Colors, ColorsData, NullColors, Settings

Constant Summary collapse

DEFAULT_LEVEL =
'info'.freeze
VERSION =
"1.3.3"

Class Method Summary collapse

Class Method Details

.colors(name, &block) ⇒ Object



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

def self.colors(name, &block)
  settings.colors[name.to_s] = Colors.new(name, &block) if !block.nil?
  settings.colors[name.to_s]
end

.file(name, &block) ⇒ Object



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

def self.file(name, &block)
  settings.outputs[name.to_s] = Outputs::File.new(&block)
end

.outputs(name) ⇒ Object



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

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

.resetObject



18
19
20
21
# File 'lib/logsly.rb', line 18

def self.reset
  @settings = nil
  Logsly::Logging182.reset
end

.settingsObject



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

def self.settings
  @settings ||= Settings.new
end

.stdout(name, &block) ⇒ Object



32
33
34
# File 'lib/logsly.rb', line 32

def self.stdout(name, &block)
  settings.outputs[name.to_s] = Outputs::Stdout.new(&block)
end

.syslog(name, &block) ⇒ Object



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

def self.syslog(name, &block)
  settings.outputs[name.to_s] = Outputs::Syslog.new(&block)
end