Apama  10.11.3.3
AP_Logger.h File Reference

AP_Logger.h. More...

#include <AP_Platform.h>
#include <stdarg.h>

Go to the source code of this file.

Enumerations

enum  AP_LogLevel
 Enumeration of logging verbosity levels. More...
 

Functions

AP_COMMON_API void AP_COMMON_CALL AP_LogTrace (const char *message,...)
 Log a message at TRACE level. More...
 
AP_COMMON_API void AP_COMMON_CALL AP_LogDebug (const char *message,...)
 Log a message at DEBUG level. More...
 
AP_COMMON_API void AP_COMMON_CALL AP_LogInfo (const char *message,...)
 Log a message at INFO level. More...
 
AP_COMMON_API void AP_COMMON_CALL AP_LogWarn (const char *message,...)
 Log a message at WARN level. More...
 
AP_COMMON_API void AP_COMMON_CALL AP_LogError (const char *message,...)
 Log a message at ERROR level. More...
 
AP_COMMON_API void AP_COMMON_CALL AP_LogForce (const char *message,...)
 Always log a message. More...
 
AP_COMMON_API void AP_COMMON_CALL AP_LogCrit (const char *message,...)
 Log a message at CRIT level. More...
 
AP_COMMON_API void AP_COMMON_CALL AP_LogFatal (const char *message,...)
 Log a message at FATAL level. More...
 
AP_COMMON_API void AP_COMMON_CALL AP_DoLog (enum AP_LogLevel level, const char *message, va_list args)
 Log a message at a specific log level. More...
 
AP_COMMON_API void AP_COMMON_CALL AP_DoLogV (enum AP_LogLevel level, const char *message,...)
 Log a message at a specific log level. More...
 
AP_COMMON_API enum AP_LogLevel AP_COMMON_CALL AP_StringToLogLevel (const char *str)
 Utility function to convert a character string to a logging verbosity level from the AP_LogLevel enumeration. More...
 
AP_COMMON_API const char *AP_COMMON_CALL AP_LogLevelToString (enum AP_LogLevel level)
 Utility function to convert a logging verbosity level from the AP_LogLevel enumeration to a human-readable character string. More...
 
AP_COMMON_API enum AP_LogLevel AP_COMMON_CALL AP_GetLogLevel ()
 Get the current logging level. More...
 
AP_COMMON_API const char *AP_COMMON_CALL AP_GetLogFileName ()
 Get the current logging destination. More...
 
AP_COMMON_API const char *AP_COMMON_CALL AP_GetUTF8LogFileName ()
 Get the current logging destination. More...
 

Detailed Description

AP_Logger.h.

Apama logging API declarations for use only in the IAF and IAF plugins (not correlator plugins).

$Copyright(c) 2002-2009, 2011-2013 Progress Software Corporation (PSC). All rights reserved.$ $Copyright (c) 2013-2018 Software AG, Darmstadt, Germany and/or Software AG USA Inc., Reston, VA, USA, and/or its subsidiaries and/or its affiliates and/or their licensors.$ Use, reproduction, transfer, publication or disclosure is prohibited except as specifically provided for in your License Agreement with Software AG

Id
AP_Logger.h 340061 2018-10-29 10:52:53Z jhea

Logging Support.

Enumeration Type Documentation

◆ AP_LogLevel

Enumeration of logging verbosity levels.

In order of increasing verbosity, the levels are: NULL < OFF < FORCE < CRIT < FATAL < ERROR < WARN < INFO < DEBUG. Messages logged at level X will be sent to the log if the current level is >= X.

Function Documentation

◆ AP_DoLog()

AP_COMMON_API void AP_COMMON_CALL AP_DoLog ( enum AP_LogLevel  level,
const char *  message,
va_list  args 
)

Log a message at a specific log level.

Parameters
levelThe level to log the message at. The message will only appear in the log file if the current logging level is equal to or greater than the specified level.
messageThe message to be logged. This is a standard printf() format string; any values required by the formatting should be passed in the args parameter.
argsStandard C varargs argument list holding any additional data required by the printf format string in message.

◆ AP_DoLogV()

AP_COMMON_API void AP_COMMON_CALL AP_DoLogV ( enum AP_LogLevel  level,
const char *  message,
  ... 
)

Log a message at a specific log level.

Parameters
levelThe level to log the message at. The message will only appear in the log file if the current logging level is equal to or greater than the specified level.
messageThe message to be logged. This is a standard printf() format string; any values required by the formatting should be passed as additional arguments to the AP_DoLogV() call.

◆ AP_GetLogFileName()

AP_COMMON_API const char* AP_COMMON_CALL AP_GetLogFileName ( )

Get the current logging destination.

Returns
The current logging file name. This may be one of the special values "stderr" or "stdout". In all cases, the returned string is owned by the logger and should not be freed or otherwise modified by the caller.

◆ AP_GetLogLevel()

AP_COMMON_API enum AP_LogLevel AP_COMMON_CALL AP_GetLogLevel ( )

Get the current logging level.

Returns
The current logging level

◆ AP_GetUTF8LogFileName()

AP_COMMON_API const char* AP_COMMON_CALL AP_GetUTF8LogFileName ( )

Get the current logging destination.

Returns
The current logging file namein UTF8. This may be one of the special values "stderr" or "stdout". In all cases, the returned string is owned by the logger and should not be freed or otherwise modified by the caller.

◆ AP_LogCrit()

AP_COMMON_API void AP_COMMON_CALL AP_LogCrit ( const char *  message,
  ... 
)

Log a message at CRIT level.

Note that the message will only appear in the log file if the current logging level is AP_LogLevel_CRIT or greater.

Parameters
messageThe message to be logged. This is a standard printf() format string; any values required by the formatting should be passed as additional arguments to the AP_LogCrit() call.

◆ AP_LogDebug()

AP_COMMON_API void AP_COMMON_CALL AP_LogDebug ( const char *  message,
  ... 
)

Log a message at DEBUG level.

Note that the message will only appear in the log file if the current logging level is AP_LogLevel_DEBUG or greater.

Parameters
messageThe message to be logged. This is a standard printf() format string; any values required by the formatting should be passed as additional arguments to the AP_LogDebug() call.

◆ AP_LogError()

AP_COMMON_API void AP_COMMON_CALL AP_LogError ( const char *  message,
  ... 
)

Log a message at ERROR level.

Note that the message will only appear in the log file if the current logging level is AP_LogLevel_ERROR or greater.

Parameters
messageThe message to be logged. This is a standard printf() format string; any values required by the formatting should be passed as additional arguments to the AP_LogError() call.

◆ AP_LogFatal()

AP_COMMON_API void AP_COMMON_CALL AP_LogFatal ( const char *  message,
  ... 
)

Log a message at FATAL level.

Note that the message will only appear in the log file if the current logging level is AP_LogLevel_FATAL or greater.

Parameters
messageThe message to be logged. This is a standard printf() format string; any values required by the formatting should be passed as additional arguments to the AP_LogFatal() call.

◆ AP_LogForce()

AP_COMMON_API void AP_COMMON_CALL AP_LogForce ( const char *  message,
  ... 
)

Always log a message.

Parameters
messageThe message to be logged. This is a standard printf() format string; any values required by the formatting should be passed as additional arguments to the AP_LogCrit() call.

◆ AP_LogInfo()

AP_COMMON_API void AP_COMMON_CALL AP_LogInfo ( const char *  message,
  ... 
)

Log a message at INFO level.

Note that the message will only appear in the log file if the current logging level is AP_LogLevel_INFO or greater.

Parameters
messageThe message to be logged. This is a standard printf() format string; any values required by the formatting should be passed as additional arguments to the AP_LogInfo() call.

◆ AP_LogLevelToString()

AP_COMMON_API const char* AP_COMMON_CALL AP_LogLevelToString ( enum AP_LogLevel  level)

Utility function to convert a logging verbosity level from the AP_LogLevel enumeration to a human-readable character string.

Parameters
levelThe logging level to be converted.
Returns
A character string corresponding to the logging level. This will be one of the strings "OFF", "CRIT", "FATAL", "ERROR", "WARN", "INFO", "DEBUG", "TRACE" or "NULL". The string "NULL" will be returned for any unknown level.

◆ AP_LogTrace()

AP_COMMON_API void AP_COMMON_CALL AP_LogTrace ( const char *  message,
  ... 
)

Log a message at TRACE level.

Note that the message will only appear in the log file if the current logging level is AP_LogLevel_TRACE or greater.

Parameters
messageThe message to be logged. This is a standard printf() format string; any values required by the formatting should be passed as additional arguments to the AP_LogTrace() call.

◆ AP_LogWarn()

AP_COMMON_API void AP_COMMON_CALL AP_LogWarn ( const char *  message,
  ... 
)

Log a message at WARN level.

Note that the message will only appear in the log file if the current logging level is AP_LogLevel_WARN or greater.

Parameters
messageThe message to be logged. This is a standard printf() format string; any values required by the formatting should be passed as additional arguments to the AP_LogWarn() call.

◆ AP_StringToLogLevel()

AP_COMMON_API enum AP_LogLevel AP_COMMON_CALL AP_StringToLogLevel ( const char *  str)

Utility function to convert a character string to a logging verbosity level from the AP_LogLevel enumeration.

May be useful if you wish to set the log level based on the value of a configuration parameter.

Parameters
strThe string to be converted. A case-insensitive comparison is performed against the values "OFF", "CRIT", "FATAL", "ERROR", "WARN", "INFO", "DEBUG" and "TRACE".
Returns
The logging level corresponding to str. AP_LogLevel_NULL will be returned for any unrecognised string.