ngfd-plugin: /build/ngfd/src/ngfd-1.4.1/src/include/ngf/log.h File Reference

ngfd-plugin

Macros | Typedefs | Enumerations | Functions
log.h File Reference
`#include <stdarg.h>`

Go to the source code of this file.

## Macros
#define | N_ENTER(...) do { n_log_message (N_LOG_LEVEL_ENTER, (const char*) __FUNCTION__, __LINE__, __VA_ARGS__); } while(0)
| Log function enter message.
#define | N_DEBUG(...) do { n_log_message (N_LOG_LEVEL_DEBUG, (const char*) __FUNCTION__, __LINE__, __VA_ARGS__); } while(0)
| Log debug message.
#define | N_INFO(...) do { n_log_message (N_LOG_LEVEL_INFO, (const char*) __FUNCTION__, __LINE__, __VA_ARGS__); } while(0)
| Log info message.
#define | N_WARNING(...) do { n_log_message (N_LOG_LEVEL_WARNING, (const char*) __FUNCTION__, __LINE__, __VA_ARGS__); } while(0)
| Log warning message.
#define | N_ERROR(...) do { n_log_message (N_LOG_LEVEL_ERROR, (const char*) __FUNCTION__, __LINE__, __VA_ARGS__); } while(0)
| Log error message.

## Typedefs
typedef enum _NLogTarget | NLogTarget
typedef enum _NLogLevel | NLogLevel
| Logging levels.

## Enumerations
enum | _NLogTarget { N_LOG_TARGET_NONE = 0 , N_LOG_TARGET_STDOUT , N_LOG_TARGET_SYSLOG }
enum | _NLogLevel { N_LOG_LEVEL_ENTER = 0 , N_LOG_LEVEL_DEBUG = 1 , N_LOG_LEVEL_INFO = 2 , N_LOG_LEVEL_WARNING = 3 , N_LOG_LEVEL_ERROR = 4 , N_LOG_LEVEL_NONE = 5 }
| Logging levels. More...

## Functions
void | n_log_initialize (NLogLevel level)
| Initialize logging with selected level.
void | n_log_set_level (NLogLevel level)
| Change logging level.
NLogLevel | n_log_get_level ()
| Get current logging level.
void | n_log_set_target (NLogTarget target)
| Select log target.
NLogTarget | n_log_get_target ()
| Get current log target.
void | n_log_message (NLogLevel level, const char *function, int line, const char *fmt,...)
| Log message.

## Macro Definition Documentation

## ◆ N_DEBUG

#define N_DEBUG | ( |  | ... | ) | do { n_log_message (N_LOG_LEVEL_DEBUG, (const char*) __FUNCTION__, __LINE__, __VA_ARGS__); } while(0)

Log debug message.

## ◆ N_ENTER

#define N_ENTER | ( |  | ... | ) | do { n_log_message (N_LOG_LEVEL_ENTER, (const char*) __FUNCTION__, __LINE__, __VA_ARGS__); } while(0)

Log function enter message.

## ◆ N_ERROR

#define N_ERROR | ( |  | ... | ) | do { n_log_message (N_LOG_LEVEL_ERROR, (const char*) __FUNCTION__, __LINE__, __VA_ARGS__); } while(0)

Log error message.

## ◆ N_INFO

#define N_INFO | ( |  | ... | ) | do { n_log_message (N_LOG_LEVEL_INFO, (const char*) __FUNCTION__, __LINE__, __VA_ARGS__); } while(0)

Log info message.

## ◆ N_WARNING

#define N_WARNING | ( |  | ... | ) | do { n_log_message (N_LOG_LEVEL_WARNING, (const char*) __FUNCTION__, __LINE__, __VA_ARGS__); } while(0)

Log warning message.

## Typedef Documentation

## ◆ NLogLevel

typedef enum _NLogLevel NLogLevel

Logging levels.

Selected level also includes all messages from higher levels

## ◆ NLogTarget

typedef enum _NLogTarget NLogTarget

## Enumeration Type Documentation

## ◆ _NLogLevel

enum _NLogLevel

Logging levels.

Selected level also includes all messages from higher levels

Enumerator
N_LOG_LEVEL_ENTER | Function enter messages.
N_LOG_LEVEL_DEBUG | Debug messages.
N_LOG_LEVEL_INFO | Info messages.
N_LOG_LEVEL_WARNING | Warning messages.
N_LOG_LEVEL_ERROR | Error messages.
N_LOG_LEVEL_NONE | Suppress logging.

## ◆ _NLogTarget

enum _NLogTarget

Enumerator
N_LOG_TARGET_NONE | Suppress logging.
N_LOG_TARGET_STDOUT | Direct logging to stdout.
N_LOG_TARGET_SYSLOG | Direct logging to syslog.

## Function Documentation

## ◆ n_log_get_level()

NLogLevel n_log_get_level | ( |  | ) |

Get current logging level.

## ◆ n_log_get_target()

NLogTarget n_log_get_target | ( |  | ) |

Get current log target.

Parameters

  target | Log target

## ◆ n_log_initialize()

void n_log_initialize | ( | NLogLevel | level | ) |

Initialize logging with selected level.

Parameters

  level | Logging level

## ◆ n_log_message()

void n_log_message | ( | NLogLevel | level,
|  | const char * | function,
|  | int | line,
|  | const char * | fmt,
|  |  | ... )

Log message.

Use convenience functions to send actual messages.

Parameters

  level | Logging level
  function | Function to which the message is related to
  line | Code line where log message was sent
  fmt | printf style formatting string
  ... | Variables

## ◆ n_log_set_level()

void n_log_set_level | ( | NLogLevel | level | ) |

Change logging level.

Parameters

  level | Logging level

## ◆ n_log_set_target()

void n_log_set_target | ( | NLogTarget | target | ) |

Select log target.

Parameters

  target | Log target