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

VERSION =
"1.3.1"

Class Method Summary collapse

Class Method Details

.colors(name, &block) ⇒ Object



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

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



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

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

.outputs(name) ⇒ Object



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

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

.resetObject



15
16
17
18
# File 'lib/logsly.rb', line 15

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

.settingsObject



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

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

.stdout(name, &block) ⇒ Object



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

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

.syslog(name, &block) ⇒ Object



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

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