Class: Baha::Log

Inherits:
Object
  • Object
show all
Defined in:
lib/baha/log.rb

Defined Under Namespace

Classes: Formatter

Constant Summary collapse

LEVELS =
{
    :debug => Logger::DEBUG,
    :info  => Logger::INFO,
    :warn  => Logger::WARN,
    :error => Logger::ERROR,
    :fatal => Logger::FATAL
}

Class Attribute Summary collapse

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(progname) ⇒ Log

Returns a new instance of Log.



65
66
67
# File 'lib/baha/log.rb', line 65

def initialize(progname)
  @progname = progname
end

Class Attribute Details

.ioObject (readonly)

Returns the value of attribute io.



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

def io
  @io
end

.levelObject

Returns the value of attribute level.



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

def level
  @level
end

.logfileObject

Returns the value of attribute logfile.



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

def logfile
  @logfile
end

Instance Attribute Details

#prognameObject (readonly)

Returns the value of attribute progname.



63
64
65
# File 'lib/baha/log.rb', line 63

def progname
  @progname
end

Class Method Details

.close!Object



52
53
54
55
56
57
# File 'lib/baha/log.rb', line 52

def close!
  if @logfile
    @logfile.close
    @logfile = nil
  end
end

.for_name(progname) ⇒ Object



58
59
60
# File 'lib/baha/log.rb', line 58

def for_name(progname)
  Baha::Log.new(progname)
end