module xdc.runtime.LoggerBuf

A logger which stores Log events in a buffer

This module provides a logger which captures Log events to a buffer in realtime. The Log events stored in the buffer are unformatted; Log event formatting is deferred until some client reads the raw event data from the buffer. You can use LoggerBuf_flush() to process the Log events stored in the buffer and stream the formatted output to stdout (via System.printf). Alternatively, you can read a raw event (via getNextEntry) and send it to another client that has the resources to format the event for display. [ more ... ]
C synopsis target-domain sourced in xdc/runtime/LoggerBuf.xdc
#include <xdc/runtime/LoggerBuf.h>
Functions
Void
Void
Void
Void 
Void 
Int 
Void
Void 
Functions common to all ILogger modules
Bool 
Bool 
Void 
Void 
Void 
Void 
Void 
LoggerBuf_write8// Process a log event with up to 8 arguments(LoggerBuf_Handle handle, Log_Event evt, Types_ModuleId mid, IArg a1, IArg a2, IArg a3, IArg a4, IArg a5, IArg a6, IArg a7, IArg a8);
Functions common to all IFilterLogger modules
Void 
Functions common to all target instances
Functions common to all target modules
Typedefs
typedef enum
typedef struct
typedef struct
typedef struct
Constants
extern const Bool 
extern const Error_Id 
extern const Bool 
extern const Diags_Mask 
extern const Diags_Mask 
extern const Diags_Mask 
extern const Diags_Mask 
extern const ILogger_Handle 
 
DETAILS
This module provides a logger which captures Log events to a buffer in realtime. The Log events stored in the buffer are unformatted; Log event formatting is deferred until some client reads the raw event data from the buffer. You can use LoggerBuf_flush() to process the Log events stored in the buffer and stream the formatted output to stdout (via System.printf). Alternatively, you can read a raw event (via getNextEntry) and send it to another client that has the resources to format the event for display.
The implementation of this logger is fast with minimal stack usage making it appropriate for a realtime application. This logger writes all Log events to a circular buffer. As a result, the execution time of all Log methods bound to this type of logger are deterministic (and quite short) because there are no additional memory allocation calls after the circular buffer was allocated.
If this logger is used in a preemptive environment, then an appropriate gate must be assigned to the module. For example, if events are generated from an interrupt context, then a gate that disables interrupts must be used.
  var LoggerBuf = xdc.useModule('xdc.runtime.LoggerBuf');
  LoggerBuf.common$.gate = ...some gate instance...
If the buffer type is circular, the log buffer of size numEntries contains the last numEntries of Log events. If the buffer type is fixed, the log buffer contains the first numEntries events.
LoggerBuf supports routing of 'STATUS' events (errors and warnings) to a separate ILogger instance. This is helpful in preserving these critical events, which may otherwise be overwritten by lower priority events. This feature is disabled by default. See statusLogger.
LoggerBuf implements the IFilterLogger interface and optionally supports filtering of events based on their detail level. This feature is disabled by default. See IFilterLogger.
EXAMPLES
Configuration example: The following XDC configuration statements create a logger instance, assign it as the default logger for all modules, and enable USER1 logging in all modules of the package my.pkg. See the Diags.setMaskMeta() function for details on specifying the module names.
  var Defaults = xdc.useModule('xdc.runtime.Defaults');
  var Diags = xdc.useModule('xdc.runtime.Diags');
  var LoggerBuf = xdc.useModule('xdc.runtime.LoggerBuf');

  LoggerBuf.enableFlush = true;
  var LoggerBufParams = new LoggerBuf.Params();
  LoggerBufParams.exitFlush = true;
  Defaults.common$.logger = LoggerBuf.create(LoggerBufParams);
  Diags.setMaskMeta("my.pkg.%", Diags.USER1, Diags.RUNTIME_ON);
 
enum LoggerBuf_BufType

Type of log buffer

C synopsis target-domain
typedef enum LoggerBuf_BufType {
    LoggerBuf_BufType_CIRCULAR,
    // The log buffer wraps, overwriting old entries
    LoggerBuf_BufType_FIXED
    // The log buffer halts collection when full
} LoggerBuf_BufType;
 
 
config LoggerBuf_E_badLevel  // module-wide

Error raised if get or setFilterLevel receives a bad level value

C synopsis target-domain
extern const Error_Id LoggerBuf_E_badLevel;
 
 
config LoggerBuf_enableFlush  // module-wide

Flush all logs at system exit

C synopsis target-domain
extern const Bool LoggerBuf_enableFlush;
 
 
config LoggerBuf_filterByLevel  // module-wide

Support filtering of events by event level

C synopsis target-domain
extern const Bool LoggerBuf_filterByLevel;
 
DETAILS
To improve logging performance, this feature can be disabled by setting filterByLevel to false.
See 'setFilterLevel' for an explanation of level filtering.
 
config LoggerBuf_level1Mask  // module-wide

Mask of diags categories whose initial filtering level is Diags.LEVEL1

C synopsis target-domain
extern const Diags_Mask LoggerBuf_level1Mask;
 
DETAILS
See 'level4Mask' for details.
 
config LoggerBuf_level2Mask  // module-wide

Mask of diags categories whose initial filtering level is Diags.LEVEL2

C synopsis target-domain
extern const Diags_Mask LoggerBuf_level2Mask;
 
DETAILS
See 'level4Mask' for details.
 
config LoggerBuf_level3Mask  // module-wide

Mask of diags categories whose initial filtering level is Diags.LEVEL3

C synopsis target-domain
extern const Diags_Mask LoggerBuf_level3Mask;
 
DETAILS
See 'level4Mask' for details.
 
config LoggerBuf_level4Mask  // module-wide

Mask of diags categories whose initial filtering level is Diags.LEVEL4

C synopsis target-domain
extern const Diags_Mask LoggerBuf_level4Mask;
 
DETAILS
If IFilterLogger.filterByLevel is true, then all LoggerBuf instances will filter incoming events based on their event level.
The LoggerBuf module allows for specifying a different filter level for every Diags bit. These filtering levels are module wide; LoggerBuf does not support specifying the levels on a per-instance basis.
The IFilterLogger.setFilterLevel function can be used to change the filtering levels at runtime.
The default filtering levels are assigned using the level1Mask - level4Mask config parameters. These are used to specify, for each of the four event levels, the set of bits which should filter at that level by default.
The default filtering configuration sets the filter level to Diags.LEVEL4 for all logging-related diags bits so that all events are logged by default.
 
config LoggerBuf_statusLogger  // module-wide

Route all 'STATUS' (error and warning) events to this logger

C synopsis target-domain
extern const ILogger_Handle LoggerBuf_statusLogger;
 
DETAILS
If a statusLogger is specified, all LoggerBuf instances will check to determine if any of the events they receive are errors or warnings (if their diags mask includes the STATUS category), and will log these events to the statusLogger.
Error events are infrequent, but it's generally critical that they be seen. In a typical system, non-error events easily outnumber any error events, and the logger is likely to wrap, overwriting any error events. To protect these events from being overwritten and lost, they can be sent to their own separate logger to preserve them.
The default value is null, indicating that the STATUS events will just be logged by the logger they were sent to.
 
LoggerBuf_flushAll()  // module-wide

Flush logs of all instances that set exitFlush to true

C synopsis target-domain
Void LoggerBuf_flushAll();
 
DETAILS
The user is responsible for making sure that no LoggerBuf instances are created or deleted during the execution of this function.
Module-Wide Built-Ins

C synopsis target-domain
Types_ModuleId LoggerBuf_Module_id();
// Get this module's unique id
 
Bool LoggerBuf_Module_startupDone();
// Test if this module has completed startup
 
IHeap_Handle LoggerBuf_Module_heap();
// The heap from which this module allocates memory
 
Bool LoggerBuf_Module_hasMask();
// Test whether this module has a diagnostics mask
 
Bits16 LoggerBuf_Module_getMask();
// Returns the diagnostics mask for this module
 
Void LoggerBuf_Module_setMask(Bits16 mask);
// Set the diagnostics mask for this module
Instance Object Types

C synopsis target-domain
typedef struct LoggerBuf_Object LoggerBuf_Object;
// Opaque internal representation of an instance object
 
typedef LoggerBuf_Object *LoggerBuf_Handle;
// Client reference to an instance object
 
typedef struct LoggerBuf_Struct LoggerBuf_Struct;
// Opaque client structure large enough to hold an instance object
 
LoggerBuf_Handle LoggerBuf_handle(LoggerBuf_Struct *structP);
// Convert this instance structure pointer into an instance handle
 
LoggerBuf_Struct *LoggerBuf_struct(LoggerBuf_Handle handle);
// Convert this instance handle into an instance structure pointer
Instance Config Parameters

C synopsis target-domain
typedef struct LoggerBuf_Params {
// Instance config-params structure
    IInstance_Params *instance;
    // Common per-instance configs
    IHeap_Handle bufHeap;
    // The heap that contains the Log buffer for dynamic instances
    LoggerBuf_BufType bufType;
    // Log buffer type
    Bool exitFlush;
    // Flush log at system exit
    Int numEntries;
    // Number of entries in buffer
} LoggerBuf_Params;
 
Void LoggerBuf_Params_init(LoggerBuf_Params *params);
// Initialize this config-params structure with supplier-specified defaults before instance creation
 
config LoggerBuf_Params.bufHeap  // instance

The heap that contains the Log buffer for dynamic instances

C synopsis target-domain
struct LoggerBuf_Params {
      ...
    IHeap_Handle bufHeap;
 
DETAILS
The default value null means the buffer will be allocated from the Memory.defaultHeapInstance heap.
 
config LoggerBuf_Params.bufType  // instance

Log buffer type

C synopsis target-domain
struct LoggerBuf_Params {
      ...
    LoggerBuf_BufType bufType;
 
 
config LoggerBuf_Params.exitFlush  // instance

Flush log at system exit

C synopsis target-domain
struct LoggerBuf_Params {
      ...
    Bool exitFlush;
 
DETAILS
Only used when module parameter enableFlush is true.
 
config LoggerBuf_Params.numEntries  // instance

Number of entries in buffer

C synopsis target-domain
struct LoggerBuf_Params {
      ...
    Int numEntries;
 
DETAILS
Each entry is large enough to store one Log event containing up to 4 optional arguments. Events containing more than 4 arguments (such as those from Log.write5) use 2 entries.
numEntries must be a power of 2.
Runtime Instance Creation

C synopsis target-domain
LoggerBuf_Handle LoggerBuf_create(const LoggerBuf_Params *params, Error_Block *eb);
// Allocate and initialize a new instance object and return its handle
 
Void LoggerBuf_construct(LoggerBuf_Struct *structP, const LoggerBuf_Params *params, Error_Block *eb);
// Initialize a new instance object inside the provided structure
ARGUMENTS
params — per-instance config params, or NULL to select default values (target-domain only)
eb — active error-handling block, or NULL to select default policy (target-domain only)
SEE
Instance Deletion

C synopsis target-domain
Void LoggerBuf_delete(LoggerBuf_Handle *handleP);
// Finalize and free this previously allocated instance object, setting the referenced handle to NULL
 
Void LoggerBuf_destruct(LoggerBuf_Struct *structP);
// Finalize the instance object inside the provided structure
 
LoggerBuf_disable()  // instance

Disable a log

C synopsis target-domain
Bool LoggerBuf_disable(LoggerBuf_Handle handle);
 
ARGUMENTS
handle — handle of a previously-created LoggerBuf instance object
DETAILS
Events written to a disabled log are silently discarded.
RETURNS
The function returns the state of the log (TRUE if enabled, FALSE if disabled) before the call. This return value allows clients to restore the previous state. Note: not thread safe.
 
LoggerBuf_enable()  // instance

Enable a log

C synopsis target-domain
Bool LoggerBuf_enable(LoggerBuf_Handle handle);
 
ARGUMENTS
handle — handle of a previously-created LoggerBuf instance object
RETURNS
The function returns the state of the log (TRUE if enabled, FALSE if disabled) before the call. This return value allows clients to restore the previous state. Note: not thread safe.
 
LoggerBuf_flush()  // instance

Read, clear, and output the contents of the log

C synopsis target-domain
Void LoggerBuf_flush(LoggerBuf_Handle handle);
 
ARGUMENTS
handle — handle of a previously-created LoggerBuf instance object
DETAILS
This method reads, clears, and "prints" each Log event (via System.printf) in the log.
 
LoggerBuf_getFilterLevel()  // instance

Returns the mask of diags categories currently set to the specified level

C synopsis target-domain
Diags_Mask LoggerBuf_getFilterLevel(LoggerBuf_Handle handle, Diags_EventLevel level);
 
ARGUMENTS
handle — handle of a previously-created LoggerBuf instance object
DETAILS
See 'setFilterLevel' for an explanation of level filtering.
 
LoggerBuf_getNextEntry()  // instance

Fills the passed Log.EventRec with the next entry in the log

C synopsis target-domain
Int LoggerBuf_getNextEntry(LoggerBuf_Handle handle, Log_EventRec *evtRec);
 
ARGUMENTS
handle — handle of a previously-created LoggerBuf instance object
evtRec — pointer to a supplied EventRec object where the next entry in the log is copied to
DETAILS
This function is used to read and clear Log events from the buffer maintained by the LoggerBuf instance. The Log event can then be transmitted and displayed on a host.
A read pointer is maintained in the LoggerBuf instance and points to the next record to read. Entries are not necessarily returned in chronological order, since buffers of type BufType_CIRCULAR can wrap.
RETURNS
This function reports the number of entries actually read. The only values that can be returned are:
  • 0 no more entries to read
  • 1 or 2 read a complete entry written by write4 or write8
  • -1 cleared an incomplete/overwritten entry, more entries to read
 
LoggerBuf_reset()  // instance

Reset a log to empty state and enable it

C synopsis target-domain
Void LoggerBuf_reset(LoggerBuf_Handle handle);
 
ARGUMENTS
handle — handle of a previously-created LoggerBuf instance object
WARNING
This method is not synchronized with other instance methods and, as a result, it must never be called when there is a chance that another instance method is currently in operation or when another method on this instance may preempt this call.
 
LoggerBuf_setFilterLevel()  // instance

Set the level of detail that instances will log

C synopsis target-domain
Void LoggerBuf_setFilterLevel(LoggerBuf_Handle handle, Diags_Mask mask, Diags_EventLevel filterLevel);
 
ARGUMENTS
handle — handle of a previously-created LoggerBuf instance object
mask — The diags categories to set the level for
filterLevel — The new filtering level for the specified categories
DETAILS
Events with the specified level or higher will be logged, events below the specified level will be dropped.
Events are filtered first by diags category, then by level. If an event's diags category is disabled in the module's diags mask, then it will be filtered out regardless of level. The event will not even be passed to the logger.
This API allows for setting the filtering level for more than one diags category at a time. The mask parameter can be a single category or multiple categories combined, and the level will be set for all of those categories.
 
LoggerBuf_write0()  // instance

Process a log event with 0 arguments

C synopsis target-domain
Void LoggerBuf_write0(LoggerBuf_Handle handle, Log_Event evt, Types_ModuleId mid);
 
ARGUMENTS
handle — handle of a previously-created LoggerBuf instance object
DETAILS
Same as write4 except with 0 arguments rather than 4.
SEE
 
LoggerBuf_write1()  // instance

Process a log event with 1 arguments

C synopsis target-domain
Void LoggerBuf_write1(LoggerBuf_Handle handle, Log_Event evt, Types_ModuleId mid, IArg a1);
 
ARGUMENTS
handle — handle of a previously-created LoggerBuf instance object
DETAILS
Same as write4 except with 1 arguments rather than 4.
SEE
 
LoggerBuf_write2()  // instance

Process a log event with 2 arguments

C synopsis target-domain
Void LoggerBuf_write2(LoggerBuf_Handle handle, Log_Event evt, Types_ModuleId mid, IArg a1, IArg a2);
 
ARGUMENTS
handle — handle of a previously-created LoggerBuf instance object
DETAILS
Same as write4 except with 2 arguments rather than 4.
SEE
 
LoggerBuf_write4()  // instance

Process a log event with up to 4 arguments

C synopsis target-domain
Void LoggerBuf_write4(LoggerBuf_Handle handle, Log_Event evt, Types_ModuleId mid, IArg a1, IArg a2, IArg a3, IArg a4);
 
ARGUMENTS
handle — handle of a previously-created LoggerBuf instance object
evt — event to be logged
mid — module ID of the module which logged the event
a1 — arbitrary argument passed by caller
DETAILS
The evt argument is of type Log.Event, which encodes the Log.EventId, the Diags.Mask, and the Diags.EventLevel of the event. The event ID can be obtained via Types.getEventId(evt), the Diags mask can be obtained via Diags.getMask(evt), and the event level can be obtained via Diags.getLevel(evt).
The modId argument is the module ID of the module that logged the event.
The event information can be used by the logger to handle different events specially. For example, the event ID can be used to compare against other known Log.Events.
      if (Log_getEventId(MY_EVENT) == Log_getEventId(evt)) {
          :
      }
The Diags mask and event level can be used for filtering of events based on event level (see IFilterLogger), or even routing events to separate loggers based on diags category (see, for example, LoggerBuf.statusLogger).
The Diags mask and event level are useful for handling the event, but are generally not recorded by the logger because they are not needed in decoding and displaying the event. A more suitable value to record is a Types.Event, which encodes the event ID and module ID. For example, the Log.EventRec type stores a Types.Event in its record definition. A Types.Event can be created using the Types.makeEvent API given the event ID and module ID.
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.
      Log_EventId id = Log_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.
The arguments a1, a2, etc. are parameters that are to be interpreted according to the message format string associated with evt.
SEE
 
LoggerBuf_write8()  // instance

Process a log event with up to 8 arguments

C synopsis target-domain
Void LoggerBuf_write8(LoggerBuf_Handle handle, Log_Event evt, Types_ModuleId mid, IArg a1, IArg a2, IArg a3, IArg a4, IArg a5, IArg a6, IArg a7, IArg a8);
 
ARGUMENTS
handle — handle of a previously-created LoggerBuf instance object
DETAILS
Same as write4 except with 8 arguments rather than 4.
SEE
Instance Convertors

C synopsis target-domain
IFilterLogger_Handle LoggerBuf_Handle_upCast(LoggerBuf_Handle handle);
// unconditionally move one level up the inheritance hierarchy
 
LoggerBuf_Handle LoggerBuf_Handle_downCast(IFilterLogger_Handle handle);
// conditionally move one level down the inheritance hierarchy; NULL upon failure
 
ILogger_Handle LoggerBuf_Handle_upCast2(LoggerBuf_Handle handle);
// unconditionally move 2 levels up the inheritance hierarchy
 
LoggerBuf_Handle LoggerBuf_Handle_downCast2(ILogger_Handle handle);
// conditionally move 2 levels down the inheritance hierarchy; NULL upon failure
Instance Built-Ins

C synopsis target-domain
Int LoggerBuf_Object_count();
// The number of statically-created instance objects
 
LoggerBuf_Handle LoggerBuf_Object_get(LoggerBuf_Object *array, Int i);
// The handle of the i-th statically-created instance object (array == NULL)
 
LoggerBuf_Handle LoggerBuf_Object_first();
// The handle of the first dynamically-created instance object, or NULL
 
LoggerBuf_Handle LoggerBuf_Object_next(LoggerBuf_Handle handle);
// The handle of the next dynamically-created instance object, or NULL
 
IHeap_Handle LoggerBuf_Object_heap();
// The heap used to allocate dynamically-created instance objects
 
Types_Label *LoggerBuf_Handle_label(LoggerBuf_Handle handle, Types_Label *buf);
// The label associated with this instance object
 
String LoggerBuf_Handle_name(LoggerBuf_Handle handle);
// The name of this instance object
 
Configuration settings sourced in xdc/runtime/LoggerBuf.xdc
var LoggerBuf = xdc.useModule('xdc.runtime.LoggerBuf');
local proxy modules
        LoggerBuf.TimestampProxy.delegate$ = ITimestampClient.Module null
module-wide constants & types
 
    var obj = new LoggerBuf.BasicView// ;
        obj.label = String  ...
        obj.lastSerial = Int  ...
        obj.numEntries = Int  ...
        obj.type = String  ...
        obj.enabledFlag = Bool  ...
 
    var obj = new LoggerBuf.RecordView// ;
        obj.serial = Int  ...
        obj.timestampRaw = Long  ...
        obj.modName = String  ...
        obj.text = String  ...
        obj.eventId = Int  ...
        obj.eventName = String  ...
        obj.arg0 = IArg  ...
        obj.arg1 = IArg  ...
        obj.arg2 = IArg  ...
        obj.arg3 = IArg  ...
        obj.arg4 = IArg  ...
        obj.arg5 = IArg  ...
        obj.arg6 = IArg  ...
        obj.arg7 = IArg  ...
 
        obj.bufferSymbol = String  ...
        obj.bufferSize = Int  ...
module-wide config parameters
        msg: "E_badLevel: Bad filter level value: %d"
    };
 
module-wide functions
per-instance config parameters
    var params = new LoggerBuf.Params// Instance config-params object;
        params.exitFlush// Flush log at system exit = Bool false;
        params.numEntries// Number of entries in buffer = Int 64;
per-instance creation
    var inst = LoggerBuf.create// Create an instance-object(params);
 
 
proxy LoggerBuf.TimestampProxy

User supplied time-stamp proxy

Configuration settings
LoggerBuf.TimestampProxy = ITimestampClient.Module null
// some delegate module inheriting the ITimestampClient interface
    LoggerBuf.TimestampProxy.delegate$ = ITimestampClient.Module null
    // explicit access to the currently bound delegate module
 
DETAILS
This proxy allows LoggerBuf to use a timestamp server different from the server used by xdc.runtime.Timestamp. However, if not supplied by a user, this proxy defaults to whichever timestamp server is used by Timestamp.
 
enum LoggerBuf.BufType

Type of log buffer

Configuration settings
values of type LoggerBuf.BufType
    const LoggerBuf.BufType_CIRCULAR;
    // The log buffer wraps, overwriting old entries
    const LoggerBuf.BufType_FIXED;
    // The log buffer halts collection when full
 
C SYNOPSIS
 
metaonly struct LoggerBuf.BasicView
Configuration settings
var obj = new LoggerBuf.BasicView;
 
    obj.label = String  ...
    obj.lastSerial = Int  ...
    obj.numEntries = Int  ...
    obj.type = String  ...
    obj.enabledFlag = Bool  ...
 
 
metaonly struct LoggerBuf.RecordView
Configuration settings
var obj = new LoggerBuf.RecordView;
 
    obj.serial = Int  ...
    obj.timestampRaw = Long  ...
    obj.modName = String  ...
    obj.text = String  ...
    obj.eventId = Int  ...
    obj.eventName = String  ...
    obj.arg0 = IArg  ...
    obj.arg1 = IArg  ...
    obj.arg2 = IArg  ...
    obj.arg3 = IArg  ...
    obj.arg4 = IArg  ...
    obj.arg5 = IArg  ...
    obj.arg6 = IArg  ...
    obj.arg7 = IArg  ...
 
 
metaonly struct LoggerBuf.StopModeData

Data added to the RTA MetaData file to support stop mode RTA

Configuration settings
var obj = new LoggerBuf.StopModeData;
 
    obj.bufferSymbol = String  ...
    obj.bufferSize = Int  ...
 
 
config LoggerBuf.E_badLevel  // module-wide

Error raised if get or setFilterLevel receives a bad level value

Configuration settings
LoggerBuf.E_badLevel = Error.Desc {
    msg: "E_badLevel: Bad filter level value: %d"
};
 
C SYNOPSIS
 
config LoggerBuf.enableFlush  // module-wide

Flush all logs at system exit

Configuration settings
LoggerBuf.enableFlush = Bool false;
 
C SYNOPSIS
 
config LoggerBuf.filterByLevel  // module-wide

Support filtering of events by event level

Configuration settings
LoggerBuf.filterByLevel = Bool false;
 
DETAILS
To improve logging performance, this feature can be disabled by setting filterByLevel to false.
See 'setFilterLevel' for an explanation of level filtering.
C SYNOPSIS
 
config LoggerBuf.level1Mask  // module-wide

Mask of diags categories whose initial filtering level is Diags.LEVEL1

Configuration settings
LoggerBuf.level1Mask = Bits16 0;
 
DETAILS
See 'level4Mask' for details.
C SYNOPSIS
 
config LoggerBuf.level2Mask  // module-wide

Mask of diags categories whose initial filtering level is Diags.LEVEL2

Configuration settings
LoggerBuf.level2Mask = Bits16 0;
 
DETAILS
See 'level4Mask' for details.
C SYNOPSIS
 
config LoggerBuf.level3Mask  // module-wide

Mask of diags categories whose initial filtering level is Diags.LEVEL3

Configuration settings
LoggerBuf.level3Mask = Bits16 0;
 
DETAILS
See 'level4Mask' for details.
C SYNOPSIS
 
config LoggerBuf.level4Mask  // module-wide

Mask of diags categories whose initial filtering level is Diags.LEVEL4

Configuration settings
LoggerBuf.level4Mask = Bits16 Diags.ALL_LOGGING;
 
DETAILS
If IFilterLogger.filterByLevel is true, then all LoggerBuf instances will filter incoming events based on their event level.
The LoggerBuf module allows for specifying a different filter level for every Diags bit. These filtering levels are module wide; LoggerBuf does not support specifying the levels on a per-instance basis.
The IFilterLogger.setFilterLevel function can be used to change the filtering levels at runtime.
The default filtering levels are assigned using the level1Mask - level4Mask config parameters. These are used to specify, for each of the four event levels, the set of bits which should filter at that level by default.
The default filtering configuration sets the filter level to Diags.LEVEL4 for all logging-related diags bits so that all events are logged by default.
C SYNOPSIS
 
config LoggerBuf.statusLogger  // module-wide

Route all 'STATUS' (error and warning) events to this logger

Configuration settings
LoggerBuf.statusLogger = ILogger.Handle null;
 
DETAILS
If a statusLogger is specified, all LoggerBuf instances will check to determine if any of the events they receive are errors or warnings (if their diags mask includes the STATUS category), and will log these events to the statusLogger.
Error events are infrequent, but it's generally critical that they be seen. In a typical system, non-error events easily outnumber any error events, and the logger is likely to wrap, overwriting any error events. To protect these events from being overwritten and lost, they can be sent to their own separate logger to preserve them.
The default value is null, indicating that the STATUS events will just be logged by the logger they were sent to.
C SYNOPSIS
 
metaonly config LoggerBuf.common$  // module-wide

Common module configuration parameters

Configuration settings
LoggerBuf.common$ = Types.Common$ undefined;
 
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.
 
metaonly LoggerBuf.getMetaArgs()  // module-wide

Returns any meta data needed to support RTA

Configuration settings
LoggerBuf.getMetaArgs(Any inst, Any instNum) returns Any
 
DETAILS
This meta data should be returned in the form of a structure which can be converted into XML. This data is added to the RTA XML file during the application's configuration, and can be accessed later through the xdc.rta.MetaData module.
The MetaData is returned per instance of the ILogger module. The instance object is passed to the function as the first argument.
The second argument is the index of the instance in the list of the ILogger's static instances.
Instance Config Parameters

Configuration settings
var params = new LoggerBuf.Params;
// Instance config-params object
    params.bufHeap = IHeap.Handle null;
    // The heap that contains the Log buffer for dynamic instances
    params.bufSection = String null;
    // Section name for the buffer managed by the static instance
    params.bufType = LoggerBuf.BufType LoggerBuf.BufType_CIRCULAR;
    // Log buffer type
    params.exitFlush = Bool false;
    // Flush log at system exit
    params.numEntries = Int 64;
    // Number of entries in buffer
 
config LoggerBuf.Params.bufHeap  // instance

The heap that contains the Log buffer for dynamic instances

Configuration settings
var params = new LoggerBuf.Params;
  ...
params.bufHeap = IHeap.Handle null;
 
DETAILS
The default value null means the buffer will be allocated from the Memory.defaultHeapInstance heap.
C SYNOPSIS
 
config LoggerBuf.Params.bufType  // instance

Log buffer type

Configuration settings
var params = new LoggerBuf.Params;
  ...
 
C SYNOPSIS
 
config LoggerBuf.Params.exitFlush  // instance

Flush log at system exit

Configuration settings
var params = new LoggerBuf.Params;
  ...
params.exitFlush = Bool false;
 
DETAILS
Only used when module parameter enableFlush is true.
C SYNOPSIS
 
config LoggerBuf.Params.numEntries  // instance

Number of entries in buffer

Configuration settings
var params = new LoggerBuf.Params;
  ...
params.numEntries = Int 64;
 
DETAILS
Each entry is large enough to store one Log event containing up to 4 optional arguments. Events containing more than 4 arguments (such as those from Log.write5) use 2 entries.
numEntries must be a power of 2.
C SYNOPSIS
 
metaonly config LoggerBuf.Params.bufSection  // instance

Section name for the buffer managed by the static instance

Configuration settings
var params = new LoggerBuf.Params;
  ...
params.bufSection = String null;
 
DETAILS
The default section is the 'dataSection' in the platform.
Static Instance Creation

Configuration settings
var params = new LoggerBuf.Params;
// Allocate instance config-params
params.config =   ...
// Assign individual configs
 
var inst = LoggerBuf.create(params);
// Create an instance-object
ARGUMENTS
params — per-instance config params, or NULL to select default values (target-domain only)
eb — active error-handling block, or NULL to select default policy (target-domain only)
SEE
generated on Fri, 28 Feb 2014 04:56:45 GMT