Logger

API Docs

A Logger is an object with the following methods, each a log level listed in order of level:

  1. debug
  2. info
  3. notice
  4. warn
  5. error
  6. crit
  7. alert
  8. emerg

Each method takes an arbitary number of strings as arguments.

These log levels were decided upon by looking at the log levels provided by default in the popular Node.js logging library Winston.

Tennu Integration

Tennu's base plugins will always pass two arguments. The first string, called the source, being one of "Tennu", "<-", "->", or the name of a plugin prefixed with plugin such as "PluginMessages".

Tennu will never send a log level above error. Those are reserved for your plugins that do really important things.

Tennu uses the info level for showing what messages are going in and out of Tennu. The source for incoming messages is "<-" while for outgoing messages it is "->".

These methods are also callable on the client object. They have the same names except that Logger.notice is Client.note because Client.notice is used by the action plugin. Alternatively, you may use the log method which takes the log level name as the first argument with the rest of the arguments being strings that are sent as is to the appropriate method.