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.



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

def initialize(progname)
  @progname = progname
end

Class Attribute Details

.ioObject (readonly)

Returns the value of attribute io.



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

def io
  @io
end

.levelObject

Returns the value of attribute level.



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

def level
  @level
end

.logfileObject

Returns the value of attribute logfile.



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

def logfile
  @logfile
end

Instance Attribute Details

#prognameObject (readonly)

Returns the value of attribute progname.



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

def progname
  @progname
end

Class Method Details

.close!Object



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

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

.for_name(progname) ⇒ Object



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

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