Class: Rootage::Logger

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

Overview

Logger is a interface for system logger implementations.

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.of(type) ⇒ Object

Return logger class of the type.



54
55
56
# File 'lib/rootage/log.rb', line 54

def self.of(type)
  @logger[type]
end

.register(type, logger_class) ⇒ Object

Register the logger class with the type.



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

def self.register(type, logger_class)
  @logger[type] = logger_class
end

Instance Method Details

#debug(msg, pos = caller(1).first, pid = Process.pid) ⇒ Object

Log the debug message.

Raises:

  • (NotImplementedError)


94
95
96
# File 'lib/rootage/log.rb', line 94

def debug(msg, pos=caller(1).first, pid=Process.pid)
  raise NotImplementedError
end

#error(msg, pos = caller(1).first, pid = Process.pid) ⇒ Object

Log the error message.

Raises:

  • (NotImplementedError)


79
80
81
# File 'lib/rootage/log.rb', line 79

def error(msg, pos=caller(1).first, pid=Process.pid)
  raise NotImplementedError
end

#fatal(msg, pos = caller(1).first, pid = Process.pid) ⇒ Object

Log the fatal message.

Raises:

  • (NotImplementedError)


74
75
76
# File 'lib/rootage/log.rb', line 74

def fatal(msg, pos=caller(1).first, pid=Process.pid)
  raise NotImplementedError
end

#info(msg, pos = caller(1).first, pid = Process.pid) ⇒ Object

Log the info message.

Raises:

  • (NotImplementedError)


89
90
91
# File 'lib/rootage/log.rb', line 89

def info(msg, pos=caller(1).first, pid=Process.pid)
  raise NotImplementedError
end

#levelObject

Return the log level.

Raises:

  • (NotImplementedError)


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

def level
  raise NotImplementedError
end

#level=(level) ⇒ Object

Set the log level.

Raises:

  • (NotImplementedError)


69
70
71
# File 'lib/rootage/log.rb', line 69

def level=(level)
  raise NotImplementedError
end

#queued?Boolean

Return true if some messages are queued.

Returns:

  • (Boolean)

Raises:

  • (NotImplementedError)


104
105
106
# File 'lib/rootage/log.rb', line 104

def queued?
  raise NotImplementedError
end

#terminateObject

Terminate the logger.

Raises:

  • (NotImplementedError)


99
100
101
# File 'lib/rootage/log.rb', line 99

def terminate
  raise NotImplementedError
end

#warn(msg, pos = caller(1).first, pid = Process.pid) ⇒ Object

Log the warn message.

Raises:

  • (NotImplementedError)


84
85
86
# File 'lib/rootage/log.rb', line 84

def warn(msg, pos=caller(1).first, pid=Process.pid)
  raise NotImplementedError
end