Module: Radiodan::Logging

Included in:
Radiodan, MPD, MPD::Connection, MPD::Response, Panic, Player, PlaylistSync, TogglePlaylist, TouchFile, WebServer
Defined in:
lib/radiodan/logging.rb

Defined Under Namespace

Modules: ClassMethods

Constant Summary collapse

@@output =
'/dev/null'
@@level =
:DEBUG

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(klass) ⇒ Object



8
9
10
# File 'lib/radiodan/logging.rb', line 8

def self.included(klass)
  klass.extend ClassMethods
end

.levelObject



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

def self.level
  @@level
end

.level=(level) ⇒ Object



25
26
27
# File 'lib/radiodan/logging.rb', line 25

def self.level=(level)
  @@level = Logger.const_get(level.to_sym.upcase)
end

.outputObject



17
18
19
# File 'lib/radiodan/logging.rb', line 17

def self.output
  @@output
end

.output=(output) ⇒ Object



12
13
14
15
# File 'lib/radiodan/logging.rb', line 12

def self.output=(output)
  @@output = output
  STDOUT.sync = true if @@output == STDOUT
end

Instance Method Details

#loggerObject



21
22
23
# File 'lib/radiodan/logging.rb', line 21

def logger
  self.class.logger
end