XBEE_LOGLEVELGET

Section: Linux Programmer's Manual (3)
Updated: 04-Mar-2012
Index Return to Main Contents
 

NAME

xbee_logLevelGet, xbee_logLevelSet, xbee_logTargetGet, xbee_logTargetSet xbee_logRxGet, xbee_logRxSet, xbee_logTxGet, xbee_logTxSet, xbee_logColorGet, xbee_logColorSet  

SYNOPSIS

#include <xbee.h>

xbee_err xbee_logLevelGet(struct xbee *xbee, int *level);

xbee_err xbee_logLevelSet(struct xbee *xbee, int level);

xbee_err xbee_logTargetGet(struct xbee *xbee, FILE **f);

xbee_err xbee_logTargetSet(struct xbee *xbee, FILE *f);

xbee_err xbee_logRxGet(struct xbee *xbee, int *enable);

xbee_err xbee_logRxSet(struct xbee *xbee, int enabled);

xbee_err xbee_logTxGet(struct xbee *xbee, int *enable);

xbee_err xbee_logTxSet(struct xbee *xbee, int enabled);

xbee_err xbee_logColorGet(struct xbee *xbee, int *enable);

xbee_err xbee_logColorSet(struct xbee *xbee, int enabled);

 

DESCRIPTION

These functions allow you to configure and retrieve the logging options for an instance of libxbee.

The level may be any number, and indicates the verbosity of log messages. A higher number will generate a more verbose output. See xbee_log(3) for more details on how this affects log output.

You may redirect the log output using xbee_logTargetSet(). f must be an open file descriptor that will allow writing. By default, libxbee will log to stderr.

You may enable and disable various logging components using xbee_logRxSet() and xbee_logTxSet(). enable is handled as a boolean value, and will enable or disable logging of either Rx data or Tx payload data respectively.

You may also enable or disable colorized logging using xbee_logColorSet(). enable is handled as a boolean value, and will enable or disable the output of ANSI color escape sequences. Colorized output only works for TTY devices, not files. if you use xbee_logTargetSet() to log to a file, then the output will not contain ANSI color escape sequences.  

Return Value

On success these functions will return XBEE_ENONE, otherwise an error number from enum xbee_errors (as specified in <xbee.h>)  

NOTES

Some of these functions may return XBEE_ENOTIMPLEMENTED if libxbee has bee compiled with them disabled.

These settings may be configured at runtime using the following environment variables:

XBEE_LOG_LEVEL
XBEE_LOG_RX
XBEE_LOG_TX
XBEE_LOG_COLOR
 

EXAMPLE

#include <xbee.h>

struct xbee *xbee;
FILE *log;

/* initialize xbee, using xbee_setup() */

if ((log = fopen("libxbee.log", "w")) == NULL) return;

if (xbee_logTargetSet(xbee, log) != XBEE_ENONE) return;

if (xbee_logLevelSet(xbee, 100) != XBEE_ENONE) return;
 

AUTHOR

Attie Grande <attie@attie.co.uk>  

SEE ALSO

libxbee(3), xbee_setup(3), xbee_log(3)


 

Index

NAME
SYNOPSIS
DESCRIPTION
Return Value
NOTES
EXAMPLE
AUTHOR
SEE ALSO

This document was created by man2html, using the manual pages.
Time: 13:52:18 GMT, August 11, 2019