LogDaemon

Introduction

If you are analyzing the example and BSP files of a typical SCIOPTA delivery, you will see that there is often a process called SCP_logd. In the SCIOPTA “SCONF” configuration utility, you can see SCP_logd defined as a static process in the system module as follows:

LogDaemon is a process which receives log messages from a user and sends it to an output device. Therefore, the user can generate debug- and log-messages to test the program flow. By setting an adequate (low) priority of the SCP_logd process the influence on the system timing can be minimized. The LogDaemon decouples occurrence and logging of events.

 

Using LogDaemon

The following three functions are used in LogDaemon applications:

logd_t NEARPTR logd_new()
void logd_printf()
void logd_destroy()

The function logd_new() creates a new LogDaemon instance.

The function logd_printf() sends a user defined message to the LogDaemon.

The function logd_destroy() deletes an existing LogDaemon instance.

Example
.
.
logd_t NEARPTR logd;
.
logd = logd_new( “/SCP_logd”,
LOGD_INFO,
DRIVER_NAME,
0,
SC_FATAL_IF_TMO);
.
.
logd_printf (logd, LOGD_INFO, “My Message\n”);
.
.
logd_destroy (&logd);
.
.

Where to find LogDeamon

The LogDaemon process can be found in the utility library (e.g. for GNU GCC: libutil_x.a) of the SCIOPTA delivery.

Also the source code is available and can be retrieved from the following folders:

…\util\logd\logd.c
…\util\logd\kprintf.c
…\include\logd\logd.h
…\include\logd\logd.msg

Examples for LogDaemon applications can be found in the source files of the Board Support Packages:

…\bsp\…