-
Notifications
You must be signed in to change notification settings - Fork 2
Oscar Software Framework Manual Logging Module
Go to Table of Contents.
The logging module is in charge of logging messages to file and console. A log level can be set to ignore messages with less than the specified priority.
In the host implementation, a special log level SIMULATION exists, which logs messages to a separate simulation log and can be used to assemble simulation results. Normal log messages are logged in the file log, in the execution directory.
In the target implementation, the Linux syslogd daemon is used to log messages to file. The same daemon also logs kernel messages, which consequently appear in the same configurable log file. Additionally, Linux can be configured to rotate this log file, so that the total log size remains limited.
None.
None.
Following code segment demonstrates the usage of the bmp module. For the sake of simplicity, error checking as well as framework creation and destruction are neglected.
OscLog(ERROR, "An error occured (%s)!\n", /* (2) */ strerror(errno)); OscDbg(("Debugging...\n")); /* (3) */
- Set the log level for the console and the log file. The standard path of the log file is /var/log/log on the camera and ./osc_log on the host.
- Log a message. In this case at the log level ERROR.
- Log a temporary message used for debugging. This is a macro redirecting to OSCLog with log level DEBUG, which is why it needs a second set of brackets around the arguments. This macro can be redefined on release of the application, removing all temporary debug messages from the binary.