interface xdc.runtime.ILogger

Interface to service Log events

A logger is responsible for recording, transmitting, or otherwise handling Log Events generated by clients of the Log module. The Log module uses modules that implement the ILogger interface to record the log events. Most application code will use the Log module instead of directly calling the specific ILogger module implementation. [ more ... ]
XDCspec summary sourced in xdc/runtime/ILogger.xdc
interface ILogger {  ...
// inherits xdc.runtime.IModule
instance:  ...
XDCspec declarations sourced in xdc/runtime/ILogger.xdc
package xdc.runtime;
 
interface ILogger {
module-wide config parameters
 
 
instance:
per-instance functions
    Void write4// Process a log event with up to 4 arguments( Types.Event evt, IArg a1, IArg a2, IArg a3, IArg a4 );
    Void write8// Process a log event with up to 8 arguments( Types.Event evt, IArg a1, IArg a2, IArg a3, IArg a4, IArg a5, IArg a6, IArg a7, IArg a8 );
}
C synopsis target-domain
#include <xdc/runtime/ILogger.h>
per-instance object types
per-instance config parameters
        IInstance_Params *instance;
    } ILogger_Params;
 
DETAILS
A logger is responsible for recording, transmitting, or otherwise handling Log Events generated by clients of the Log module. The Log module uses modules that implement the ILogger interface to record the log events. Most application code will use the Log module instead of directly calling the specific ILogger module implementation.
All logger implementations must inherit from this interface. The derived implementations must implement the functions defined in this interface but may also add additional configuration parameters and functions.
 
metaonly config ILogger.common$  // module-wide

Common module configuration parameters

XDCspec declarations sourced in xdc/runtime/ILogger.xdc
metaonly config Types.Common$ common$;
 
DETAILS
All modules have this configuration parameter. Its name contains the '$' character to ensure it does not conflict with configuration parameters declared by the module. This allows new configuration parameters to be added in the future without any chance of breaking existing modules.
 
per-instance object types

C synopsis target-domain
typedef struct ILogger_Object *ILogger_Handle;
// Client reference to an abstract instance object
 
per-instance config parameters

XDCscript usage meta-domain
var params = new ILogger.Params;
// Instance config-params object
C synopsis target-domain
typedef struct ILogger_Params {
// Instance config-params structure
    IInstance_Params *instance;
    // Common per-instance configs
} ILogger_Params;
 
ILogger.write4( )  // per-instance

Process a log event with up to 4 arguments

XDCspec declarations sourced in xdc/runtime/ILogger.xdc
Void write4( Types.Event evt, IArg a1, IArg a2, IArg a3, IArg a4 );
 
ARGUMENTS
evt — event to be logged
a1 — arbitrary argument passed by caller
This parameter, along with a2, a3, and a4 are parameters that are to be interpreted according to the message format string associated with evt.
DETAILS
At the time this method is called, evt encodes two values: the module ID of the module that "triggered" a Log.Event and the Log.EventId of the event. The module ID can be obtained via Types.getModuleId(evt) and the event ID can be obtained via Types.getEventId(evt).
The event ID can be used to compare against other known Log.Events.
          if (Log_getEventId(MY_EVENT) == Types_getEventId(evt)) {
              :
          }
The event ID value of 0 is used to indicate an event triggered by a call to one of the Log_print[0-6] methods. These methods take a format string rather than a Log_Event argument and, as a result, the event ID encoded in evt is 0 and the parameter a1 is the format string.
Non-zero event IDs can also be used to access the msg string associated with the Log.EventDesc that originally defined the Log event.
          Types_EventId id = Types_getEventId(evt));
          if (id != 0) {
              String msg = Text_ropeText(id);
              System_aprintf(msg, a1, a2, a3, a4);
          }
This works because an event's ID is simply an offset into a table of characters (maintained by the Text module) containing the event's msg string.
SEE
 
ILogger.write8( )  // per-instance

Process a log event with up to 8 arguments

XDCspec declarations sourced in xdc/runtime/ILogger.xdc
Void write8( Types.Event evt, IArg a1, IArg a2, IArg a3, IArg a4, IArg a5, IArg a6, IArg a7, IArg a8 );
 
DETAILS
Same as write4 except with 8 arguments rather than 4.
SEE
generated on Tue, 01 Sep 2009 00:36:15 GMT