log.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <string.h>
#include <time.h>
#include <sys/time.h>
#include <stdarg.h>
#include <unistd.h>
#include <curl/curl.h>
#include "testrunnerlite.h"
#include "log.h"
Go to the source code of this file.
Function Documentation
LOCAL char * create_msg |
( |
const char * |
fmt, |
|
|
|
... | |
|
) |
| | |
Allocate buffer and print to message to it
- Parameters:
-
- Returns:
- buffer with message or NULL in case of too big message
Definition at line 97 of file log.c.
Closes the log, flush stdout and cleanup curl if it's in use
Definition at line 377 of file log.c.
Sets the verbosity level
- Parameters:
-
| opts | testrunner lite options |
Definition at line 344 of file log.c.
void log_msg |
( |
int |
type, |
|
|
const char * |
file, |
|
|
const char * |
function, |
|
|
int |
lineno, |
|
|
char * |
format, |
|
|
|
... | |
|
) |
| | |
Prints a log message to stdout in format "[LOG_TYPE] HH:MM:SS message" Usage is the same as in regular printf(), except the first parameter Example: log_msg (LOG_ERR, "Error message %s\n", "Failure");
- Parameters:
-
| type | Log type defined in log_message_types enum |
| file | Source file name the log entry corresponds to |
| function | Function emitting the log |
| lineno | Line number |
| format | Message format |
Definition at line 192 of file log.c.
LOCAL char * vcreate_msg |
( |
const char * |
fmt, |
|
|
va_list |
ap | |
|
) |
| | |
Allocate buffer and print to message to it
- Parameters:
-
| fmt | format as in printf |
| ap | argument list |
- Returns:
- buffer with message or NULL in case of too big message
Definition at line 142 of file log.c.
Variable Documentation
Definition at line 65 of file log.c.
Definition at line 66 of file log.c.
Initial value:
{"EMERG", "ALERT", "CRITICAL", "ERROR",
"WARNING", "NOTICE", "INFO", "DEBUG", "UNKNOWN" }
Definition at line 72 of file log.c.
Definition at line 77 of file log.c.