Class Rucola::Log
In: lib/rucola/log.rb
Parent: Object

The Log class is basically a wrapper around NSLog. It is a singleton class so you should get an instance using the instance class method instead of new.

  Rucola::Log.instance.fatal("Couldn't initialize application.")

The Log class is generally accessed through the log method on Kernel.

  log.debug("%d exceptions caught, giving up", exceptions.length)

Methods

debug   error   fatal   info   level_for_env   log   new   unknown   warn  

Included Modules

Singleton

Constants

DEBUG = 0
INFO = 1
WARN = 2
ERROR = 3
FATAL = 4
UNKNOWN = 5
SILENT = 9

Attributes

level  [RW]  Holds the current log level

Public Class methods

Creates a new Log instance. Don‘t call this directly, call instance instead.

  log.instance

Public Instance methods

Returns default log level for the application environment.

  log.level_for_env #=> Log::ERROR

Writes a message to the log is the current loglevel is equal or greater than the message_level.

  log.log(Log::DEBUG, "This is a debug message")

[Validate]