#include <freeradius-devel/libradius.h>
Go to the source code of this file.
#define FR_STRERROR_BUFSIZE (2048) |
Definition at line 35 of file log.c.
static void _fr_logging_free |
( |
void * |
arg | ) |
|
|
static |
void fr_canonicalize_error |
( |
TALLOC_CTX * |
ctx, |
|
|
char ** |
sp, |
|
|
char ** |
text, |
|
|
ssize_t |
slen, |
|
|
char const * |
msg |
|
) |
| |
Canonicalize error strings, removing tabs, and generate spaces for error marker.
- Note
- talloc_free must be called on the buffer returned in spaces and text
Used to produce error messages such as this:
I'm a string with a parser # error
^ Unexpected character in string
With code resembling this:
ERROR(
"%s^ %s", space, text);
- Todo:
- merge with above function (radlog_request_marker)
- Parameters
-
sp | Where to write a dynamically allocated buffer of spaces used to indent the error text. |
text | Where to write the canonicalized version of msg (the error text). |
ctx | to allocate the spaces and text buffers in. |
slen | of error marker. Expects negative integer value, as returned by parse functions. |
msg | to canonicalize. |
Definition at line 359 of file log.c.
void fr_perror |
( |
char const * |
fmt, |
|
|
|
... |
|
) |
| |
char const* fr_strerror |
( |
void |
| ) |
|
Get the last library error.
Will only return the last library error once, after which it will return a zero length string.
- Returns
- library error or zero length string.
Definition at line 212 of file log.c.
void fr_strerror_printf |
( |
char const * |
fmt, |
|
|
|
... |
|
) |
| |
Log to thread local error buffer.
- Parameters
-
fmt | printf style format string. If NULL sets the 'new' byte to false, effectively clearing the last message. |
Definition at line 152 of file log.c.
char const* fr_syserror |
( |
int |
num | ) |
|
Guaranteed to be thread-safe version of strerror.
- Parameters
-
num | errno as returned by function or from global errno. |
- Returns
- local specific error string relating to errno.
Definition at line 238 of file log.c.
fr_thread_local_setup |
( |
char * |
, |
|
|
fr_strerror_buffer |
|
|
) |
| |
POSIX-2008 errno macros.
Non-POSIX macros may be added, but you must check they're defined.
Definition at line 37 of file log.c.