Functions |
int | dlog_print (log_priority prio, const char *tag, const char *fmt,...) |
| Send log with priority and tag.
|
int | dlog_vprint (log_priority prio, const char *tag, const char *fmt, va_list ap) |
| Send log with priority, tag and va_list.
|
The Dlog API provides functions for sending log output.
Required Header
#include <dlog.h>
Overview
Sending log message to circular buffer. dlog APIs include Priority and Tag. By using priority and Tag, we can easily filtered messages what we want to see.
priority
priority level indicates the urgency of log message
Priority | Description |
DLOG_DEBUG | Debug messasge. - Log message which developer want to check. |
DLOG_INFO | Information message - Normal operational messages. above of this priority will always be logged. |
DLOG_WARN | Warning messages - Not an error, but indication that an error will occur if action is not taken. |
DLOG_ERROR | Error message - Indicate error. |
Enumeration Type Documentation
Enumeration for Dlog Error.
- Since :
- 2.3.1
- Enumerator:
DLOG_ERROR_NONE |
Successful
|
DLOG_ERROR_INVALID_PARAMETER |
Invalid parameter
|
DLOG_ERROR_NOT_PERMITTED |
Operation not permitted
|
log priority values, in ascending priority order.
- Since :
- 2.3.1
- Enumerator:
DLOG_UNKNOWN |
Keep this always at the start
|
DLOG_DEFAULT |
Default
|
DLOG_VERBOSE |
Verbose
|
DLOG_DEBUG |
Debug
|
DLOG_INFO |
Info
|
DLOG_WARN |
Warning
|
DLOG_ERROR |
Error
|
DLOG_FATAL |
Fatal
|
DLOG_SILENT |
Silent
|
DLOG_PRIO_MAX |
Keep this always at the end.
|
Function Documentation
Send log with priority and tag.
for application
- Since :
- 2.3.1
- Parameters:
-
[in] | prio | log_priority |
[in] | tag | tag |
[in] | fmt | format string |
- Returns:
- On success, the function returns the number of bytes written. On error, a negative errno-style error code
- Return values:
-
- Precondition:
- none
- Postcondition:
- none
- See also:
- dlog_vprint
#include<dlog.h>
int main(void)
{
int integer = 21;
char string[] = "test dlog";
dlog_print(DLOG_INFO, "USR_TAG", "test dlog");
dlog_print(DLOG_INFO, "USR_TAG", "%s, %d", string, integer);
return 0;
}
Send log with priority, tag and va_list.
for application
- Since :
- 2.3.1
- Parameters:
-
[in] | prio | log_priority |
[in] | tag | tag |
[in] | fmt | format string |
[in] | ap | va_list |
- Returns:
- On success, the function returns the number of bytes written. On error, a negative errno-style error code
- Return values:
-
- Precondition:
- none
- Postcondition:
- none
- See also:
- dlog_print
#include<dlog.h>
void my_debug_print(char *format, ...)
{
va_list ap;
va_start(ap, format);
dlog_vprint(DLOG_INFO, "USR_TAG", format, ap);
va_end(ap);
}
int main(void)
{
my_debug_print("%s", "test dlog");
my_debug_print("%s, %d", "test dlog", 21);
return 0;
}