XBEE_LOG
Section: Linux Programmer's Manual (3)
Updated: 04-Mar-2012
Index
Return to Main Contents
NAME
xbee_log
SYNOPSIS
#include <xbee.h>
xbee_err xbee_log(struct xbee *xbee, int minLevel, const char *format, ...);
DESCRIPTION
xbee_log()
provides a means for you to write messages to libxbee's log.
- xbee
-
is required, and will indicate which log to use
- minLevel
-
is a value that determines whether the message will be output or not.
The lower this value, the more likely.
libxbee defaults to a log level of 0, but this may be changed by specifying
XBEE_LOG_LEVEL
at build time, by specifying
XBEE_LOG_LEVEL
in the environment at run-time, or by calling
xbee_logLevelSet(3)
at run-time.
These options are applied in this order.
- format, ...
-
these options are exactly the same as those used by
printf(3).
You do not need to add a newline ('\n') character to the end, libxbee will do this for you.
Return Value
On success this function will return XBEE_ENONE, otherwise an error number from
enum xbee_errors (as specified in <xbee.h>)
EXAMPLE
#include <xbee.h>
struct xbee *xbee;
/* initialize xbee, using xbee_setup() */
xbee_log(xbee, -1, "Hello World!");
Output
DEV: -1#[main.c:14] main() 0x82dd128: Hello World!
Where:
- DEV:
-
indicates that this was a message logged from outside libxbee (within your program)
- -1
-
indicates the log level for the message
- [main.c:14]
-
indicates the filename and line number
- main()
-
indicates the function that the call to
xbee_log()
was made from
- 0x82dd128
-
indicates the address of the libxbee instance
- Hello World!
-
is the message
AUTHOR
Attie Grande <attie@attie.co.uk>
SEE ALSO
libxbee(3),
xbee_setup(3),
xbee_logTargetSet(3),
xbee_logLevelSet(3),
printf(3)
Index
- NAME
-
- SYNOPSIS
-
- DESCRIPTION
-
- Return Value
-
- EXAMPLE
-
- Output
-
- AUTHOR
-
- SEE ALSO
-
This document was created by
man2html,
using the manual pages.
Time: 13:52:18 GMT, August 11, 2019