ocsdDefaultErrorLogger Class Reference

`#include <ocsd_error_logger.h>`

Inheritance diagram for ocsdDefaultErrorLogger:
[legend]
Collaboration diagram for ocsdDefaultErrorLogger:
[legend]

## Public Member Functions

| ocsdDefaultErrorLogger ()
virtual | ~ocsdDefaultErrorLogger ()
bool | initErrorLogger (const ocsd_err_severity_t verbosity, bool bCreateOutputLogger=false)
| Initialise the error logger with a severity filter, optionally create an output logger on stderr. More...
virtual ocsdMsgLogger * | getOutputLogger ()
virtual void | setOutputLogger (ocsdMsgLogger *pLogger)
virtual const ocsd_hndl_err_log_t | RegisterErrorSource (const std::string &component_name)
virtual void | LogError (const ocsd_hndl_err_log_t handle, const ocsdError *Error)
virtual void | LogMessage (const ocsd_hndl_err_log_t handle, const ocsd_err_severity_t filter_level, const std::string &msg)
virtual const ocsd_err_severity_t | GetErrorLogVerbosity () const
virtual ocsdError * | GetLastError ()
virtual ocsdError * | GetLastIDError (const uint8_t chan_id)
Public Member Functions inherited from ITraceErrorLog
| ITraceErrorLog ()
virtual | ~ITraceErrorLog ()

## Additional Inherited Members

Public Types inherited from ITraceErrorLog
enum | generic_handles { HANDLE_GEN_ERR = 0, HANDLE_GEN_WARN, HANDLE_GEN_INFO, HANDLE_FIRST_REGISTERED_COMPONENT }

## Detailed Description

Definition at line 46 of file ocsd_error_logger.h.

## Constructor & Destructor Documentation

## ocsdDefaultErrorLogger()

ocsdDefaultErrorLogger::ocsdDefaultErrorLogger | ( |  | ) |

## ~ocsdDefaultErrorLogger()

virtual ocsdDefaultErrorLogger::~ocsdDefaultErrorLogger | ( |  | ) |

virtual

## Member Function Documentation

## GetErrorLogVerbosity()

virtual const ocsd_err_severity_t ocsdDefaultErrorLogger::GetErrorLogVerbosity | ( |  | ) | const

inline virtual

Return the verbosity level of the logger. Errors of the returned ocsd_err_severity_t severity or lower will be logged, others are ignored.

Returns
  ocsd_err_severity_t : Current logging severity level.

Implements ITraceErrorLog.

Definition at line 62 of file ocsd_error_logger.h.

## GetLastError()

virtual ocsdError* ocsdDefaultErrorLogger::GetLastError | ( |  | ) |

inline virtual

Get a pointer to the last logged error. Returns 0 if no errors have been logged.

Returns
  ocsdError *: last error pointer.

Implements ITraceErrorLog.

Definition at line 64 of file ocsd_error_logger.h.

## GetLastIDError()

virtual ocsdError* ocsdDefaultErrorLogger::GetLastIDError | ( | const uint8_t | chan_id | ) |

inline virtual

Get the last error associated with the given Trace source channel ID. returns a pointer to the error or 0 if no errors associated with the ID.

Parameters

  chan_id | : Trace Source Channel ID (CoreSight Trace ID).

Returns
  ocsdError *: last error pointer for ID or 0.

Implements ITraceErrorLog.

Definition at line 65 of file ocsd_error_logger.h.

## getOutputLogger()

virtual ocsdMsgLogger* ocsdDefaultErrorLogger::getOutputLogger | ( |  | ) |

inline virtual

Implements ITraceErrorLog.

Definition at line 54 of file ocsd_error_logger.h.

## initErrorLogger()

bool ocsdDefaultErrorLogger::initErrorLogger | ( | const ocsd_err_severity_t | verbosity,
|  | bool | bCreateOutputLogger = `false`
| ) |  |

Initialise the error logger with a severity filter, optionally create an output logger on stderr.

## LogError()

virtual void ocsdDefaultErrorLogger::LogError | ( | const ocsd_hndl_err_log_t | handle,
|  | const ocsdError * | Error
| ) |  |

virtual

Log an error. Pass an error object and the component or generic handle to associate with the error. Error will be saved for access by GetLastError().

If logger implementation has output print logging enabled then this may be printed to file or screen.

Parameters

  handle | : Component handle or standard generic handle
  *Error | : Pointer to an error object.

Implements ITraceErrorLog.

## LogMessage()

virtual void ocsdDefaultErrorLogger::LogMessage | ( | const ocsd_hndl_err_log_t | handle,
|  | const ocsd_err_severity_t | filter_level,
|  | const std::string & | msg
| ) |  |

virtual

Log a general message. Associated with component or use generic handle. Message logged to same output as errors if output enabled, but not saved for GetLastError()

Parameters

  handle | : Component handle or standard generic handle.
  filter_level | : Verbosity filter.
  msg | : Pointer to an error object.

Implements ITraceErrorLog.

## RegisterErrorSource()

virtual const ocsd_hndl_err_log_t ocsdDefaultErrorLogger::RegisterErrorSource | ( | const std::string & | component_name | ) |

virtual

Register a named component error source. Allows the logger to associate errors with components. returned handle to be used with subsequent error log calls.

Parameters

  &component_name | : name of the component.

Returns
  virtual const : Handle associated with the component.

Implements ITraceErrorLog.

## setOutputLogger()

virtual void ocsdDefaultErrorLogger::setOutputLogger | ( | ocsdMsgLogger * | pLogger | ) |

virtual

Implements ITraceErrorLog.

The documentation for this class was generated from the following file:

- /build/libopencsd-WqHKQU/libopencsd-0.12.2/decoder/include/common/ocsd_error_logger.h