Using Lumberjack

Lumberjack is made to be easy to use, but there are a few things that you ought to be aware of.

First of all, the log file is plain text, and is located in /boot/home/system.log. If you want to clear the log you may simply use the "Clear all log items" on the right-click menu.

Second, Lumberjack is not a persistant replicant. There is a very good reason why I did this, and it has to do with getting resources and some things that i'd like to do in the future. As it is, you must run lumberjack, which will then install itself in the Deskbar until Deskbar is closed. If you'd like to have lumberjack automatically startup, put it in the UserBootscript file.

There are no special things you have to do to run Lumberjack, simply double-clicking it will start it up.

 

Using Lumberjack Client Services

All client code is found in the namespace "lumberjack." This namespace must be used to reference the client code.

To send messages to the logger service, you must instantiate a class of type lumberjack::logger.

lumberjack::logger *l = new lumberjack::logger();


void log(string app, unsigned severity, unsigned event_id, string error_class, string desc);

This is the function used to send log messages. It can be used as follows:

l->log("MyApp", SEVERITY_INFO, MY_INTERNAL_EVENT_ID, "System", "MyApp started up normally.");

This is the only way to send log messages. It should be noted that the severity and event_id elements may be any unsigned integer, however severity has several predefined values below:

 
const unsigned SEVERITY_DEBUG = 0;
const unsigned SEVERITY_INFO = 1;
const unsigned SEVERITY_WARNING = 2;
const unsigned SEVERITY_ERROR = 3;
const unsigned SEVERITY_FATAL = 4; 

The event_id parameter is entirely freeform and may be used by the application to indicate any type of information it wishes to in a numeric format.

The error_class parameter was intended to indicate what portion of the system was affected by the message. The system in general can simply be referred to as "System." Other possible values for this parameter are "Disk", "Memory", "Display", or whatever you feel is appropriate for your application.

The description parameter is entirely freeform and may contain newlines. Newlines will be transformed appropriately for the display device, and kept in storage.

1