log.h File Reference

Control log messages that are not associated with a transport. More...

`#include <proton/import_export.h>`
`#include <proton/type_compat.h>`

Go to the source code of this file.

## Typedefs

typedef void(* | pn_logger_t) (const char *message)
| Callback for customized logging. More...

## Functions

PN_EXTERN void | pn_log_enable (bool enabled)
| Enable/disable global logging. More...
PN_EXTERN void | pn_log_logger (pn_logger_t logger)
| Set the logger. More...

## Detailed Description

Control log messages that are not associated with a transport.

See pn_transport_trace for transport-related logging.

## Typedef Documentation

## pn_logger_t

typedef void(* pn_logger_t) (const char *message)

Callback for customized logging.

## Function Documentation

## pn_log_enable()

PN_EXTERN void pn_log_enable | ( | bool | enabled | ) |

Enable/disable global logging.

By default, logging is enabled by envionment variable PN_TRACE_LOG. Calling this function overrides the environment setting.

## pn_log_logger()

PN_EXTERN void pn_log_logger | ( | pn_logger_t | logger | ) |

Set the logger.

By default a logger that prints to stderr is installed.

Parameters

  logger | is called with each log messsage if logging is enabled. Passing 0 disables logging regardless of pn_log_enable() or environment settings.