Main Page | Modules | Namespace List | Class Hierarchy | Class List | File List | Class Members | File Members

VXIlogInterface Implementation


Detailed Description

SBlog is an implementation of the VXIlogInterface for logging.

The SBlogInterface extends the VXIlogInterface to support a listener registration mechanism for sending the logs to the final output stream. This mechanism allows multiple systems to tap on to a single log event so it can be sent both to a file and to a central logging service is desired. Listeners are invoked through callbacks. The callback call is blocking. If a listener is going to do signficant work or invoke functions which may block, for example a socket write, a messsage queue should be implemented so that callback is non-blocking. Failure to do this will impact overall system performance.

Across all streams, SBlog is responsible for automatically supplying the following information for end consumer use:

In addition, for diagnostic logging the SBlog defines a mechanism for enabling/disabling messages on an individual tag basis without requiring a recompile for use by consumers of the diagnostic log. Diagnostic( ) is highly efficient for cases when the tag is disabled: in other words, the lookup for seeing if a tag (an integer) is enabled should be done using a simple array or some other extremely low-overhead mechanism. SBlog provides a way to enable/disable tags on-the-fly (without needing to restart the software).

Each OSB PIK component provides an XML error file which integrators can choose to us (or rewrite) to map error numbers and error key/values to error text. An XSLT transform can do this in an error viewer.


Classes

struct  SBlogStream
 SBlog definition of a VXIlogStream. More...
struct  SBlogInterface
 SBlog extension interface to the VXIlog interface. More...

Typedefs

typedef *struct SBlogStream SBlogStream
 SBlog definition of a VXIlogStream.
typedef void SBlogErrorListener (struct SBlogInterface *pThis, const VXIchar *moduleName, VXIunsigned errorID, time_t timestamp, VXIunsigned timestampMsec, const VXIVector *keys, const VXIVector *values, void *userdata)
 Prototype for error listener notification.
typedef void SBlogDiagnosticListener (struct SBlogInterface *pThis, VXIunsigned tagID, const VXIchar *subtag, time_t timestamp, VXIunsigned timestampMsec, const VXIchar *printmsg, void *userdata)
 Prototype for diagnostic listener notification All diagnostic listener registrants must conform to this signature.
typedef void SBlogEventListener (struct SBlogInterface *pThis, VXIunsigned eventID, time_t timestamp, VXIunsigned timestampMsec, const VXIVector *keys, const VXIVector *values, void *userdata)
 Prototype for event listener notification.
typedef VXIlogResult SBlogContentListener (struct SBlogInterface *pThis, const VXIchar *moduleName, const VXIchar *contentType, void *userdata, VXIString **logKey, VXIString **logValue, SBlogStream **stream)
 Prototype for content listener notification All content listener registrants must conform to this signature.
typedef SBlogInterface SBlogInterface
 SBlog extension interface to the VXIlog interface.

Functions

SBLOG_API VXIlogResult SBlogInit (void)
 Global platform initialization of SBlog.
SBLOG_API VXIlogResult SBlogShutDown (void)
 Global platform shutdown of Log.
SBLOG_API VXIlogResult SBlogCreateResource (VXIlogInterface **log)
 Create a new log service handle.
SBLOG_API VXIlogResult SBlogDestroyResource (VXIlogInterface **log)
 Destroy the interface and free internal resources.


Typedef Documentation

typedef VXIlogResult SBlogContentListener(struct SBlogInterface *pThis, const VXIchar *moduleName, const VXIchar *contentType, void *userdata, VXIString **logKey, VXIString **logValue, SBlogStream **stream)
 

Prototype for content listener notification All content listener registrants must conform to this signature.

Parameters:
pThis [IN] pointer to the SBlogInterface that issued the callback
moduleName [IN] Name of the software module that is outputting the data
contentType [IN] MIME content type for the data
userdata [IN] User data that is delivered in the callback.
logKey [OUT] Key name to cross-reference this content in logging errors, events, and/or diagnostic messages. Ownership is passed on success, the user will call VXIStringDestroy( ) to free this when no longer required.
logValue [OUT] Value to cross-reference this content in logging errors, events, and/or diagnostic messages. Ownership is passed on success, the user will call VXIStringDestroy( ) to free this when no longer required.
stream [OUT] Handle for writing the content and closing the stream

typedef void SBlogDiagnosticListener(struct SBlogInterface *pThis, VXIunsigned tagID, const VXIchar *subtag, time_t timestamp, VXIunsigned timestampMsec, const VXIchar *printmsg, void *userdata)
 

Prototype for diagnostic listener notification All diagnostic listener registrants must conform to this signature.

Parameters:
pThis [IN] pointer to the SBlogInterface that issued the callback
tagID [IN] Identifier that classifies a group of logically associated diagnostic messages (usually from a single software module) that are desirable to enable or disable as a single unit. See the top of this file for tagID allocation rules.
subtag [IN] Arbitrary string that may be used to subdivide the diagnostic messages of that tagID, or provide additional standardized information such as the source file, function, or method. There are no rules for the content of this field.
timestamp [IN] time_t the time of the log event
timestampMsec [IN] Milliseconds for the time of the log event
printmsg [IN] NULL terminated string to be printed.
userdata [IN] User data that is delivered in the callback.

typedef void SBlogErrorListener(struct SBlogInterface *pThis, const VXIchar *moduleName, VXIunsigned errorID, time_t timestamp, VXIunsigned timestampMsec, const VXIVector *keys, const VXIVector *values, void *userdata)
 

Prototype for error listener notification.

All error listener registrants must conform to this signature.

Parameters:
pThis [IN] pointer to the SBlogInterface that issued the callback
moduleName [IN] module name on which the error occurred
errorID [IN] error number
timestamp [IN] time_t for the time of the log event
timestampMsec [IN] Milliseconds for the time of the log event
keys [IN] VXIVector of keys, all VXIString types
values [IN] VXIVector of values, each a VXIInteger, VXIFloat, VXIString, or VXIPtr
userdata [IN] User data that is delivered in the callback

typedef void SBlogEventListener(struct SBlogInterface *pThis, VXIunsigned eventID, time_t timestamp, VXIunsigned timestampMsec, const VXIVector *keys, const VXIVector *values, void *userdata)
 

Prototype for event listener notification.

All event listener registrants must conform to this signature.

Parameters:
pThis [IN] pointer to the SBlogInterface that issued the callback
eventID [IN] event number
timestamp [IN] time_t for the time of the log event
timestampMsec [IN] Milliseconds for the time of the log event
keys [IN] VXIVector of keys, all VXIString types
values [IN] VXIVector of values, each a VXIInteger, VXIFloat, VXIString, or VXIPtr
userdata [IN] User data that is delivered in the callback.

typedef struct SBlogInterface SBlogInterface
 

SBlog extension interface to the VXIlog interface.

SBlog defines extensions to the VXIlog interface that support the tag mechanism and the listener registration

typedef * struct SBlogStream SBlogStream
 

SBlog definition of a VXIlogStream.

SBlog defines a log stream as the following, which contains methods for writing data and closing the stream.


Function Documentation

SBLOG_API VXIlogResult SBlogCreateResource VXIlogInterface **  log  ) 
 

Create a new log service handle.

Parameters:
log [IN/OUT] Will hold the VXIlog resource.
Returns:
VXIlog_RESULT_SUCCESS on success

SBLOG_API VXIlogResult SBlogDestroyResource VXIlogInterface **  log  ) 
 

Destroy the interface and free internal resources.

Parameters:
log [IN/OUT] The log resource created by SBlogCreateResource()
Returns:
VXIlog_RESULT_SUCCESS on success

SBLOG_API VXIlogResult SBlogInit void   ) 
 

Global platform initialization of SBlog.

Returns:
VXIlog_RESULT_SUCCESS on success

SBLOG_API VXIlogResult SBlogShutDown void   ) 
 

Global platform shutdown of Log.

Returns:
VXIlog_RESULT_SUCCESS on success


Generated on Wed Jun 1 12:50:19 2005 for OpenVXI by  doxygen 1.4.2