#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <config.h>
#include "dp_debug.h"
#include "dp_mutex.h"
Go to the source code of this file.
◆ DPTLOG_DELIMITER_DEFAULT
#define DPTLOG_DELIMITER_DEFAULT (char *)" " |
default delimiter definition
Definition at line 26 of file dp_timelog.c.
◆ DPTLOG_FAILED
#define DPTLOG_FAILED (-1) /*! error */ |
◆ DPTLOG_LOCK
◆ DPTLOG_SUCCESS
#define DPTLOG_SUCCESS (0) /*! success */ |
◆ DPTLOG_UNLOCK
◆ dp_timelog_data_t
◆ dp_timelog_data_store()
static void dp_timelog_data_store |
( |
DPTimeLog |
mng | ) |
|
|
inlinestatic |
◆ dp_timelog_exit()
Exit stored log, and show stored log.
- Parameters
-
[in] | handle | handle returned from timelog_init |
- Returns
- none
Definition at line 162 of file dp_timelog.c.
◆ dp_timelog_init()
DPTimeLog dp_timelog_init |
( |
const char * |
delimiter, |
|
|
size_t |
maxloglen, |
|
|
unsigned long |
maxstoresize, |
|
|
int |
is_threadsafe |
|
) |
| |
Init store log.
- Parameters
-
[in] | delimiter | delimiter string if you want, default:" " |
[in] | maxloglen | Max length of logs |
[in] | maxstoresize | Storaged log size. If 0, always show log |
[in] | is_threadsafe | threadsafe or not |
- Return values
-
!NULL | handle pointer to use other method |
NULL | error |
Definition at line 85 of file dp_timelog.c.
◆ dp_timelog_print()
int dp_timelog_print |
( |
DPTimeLog |
handle, |
|
|
const char * |
format, |
|
|
|
... |
|
) |
| |
Store log.
- Parameters
-
[in] | handle | handle returned from timelog_init |
[in] | format | log format as printf |
- Return values
-
0<=val | success |
other | failed (same as prinf) |
Definition at line 139 of file dp_timelog.c.
◆ dp_timelog_show()
◆ timelog_g
Implement of dp_timelog API, defined in dp_debug.h.
global timelog handle to show debug log
Definition at line 14 of file dp_timelog.c.