-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlog.h
37 lines (32 loc) · 920 Bytes
/
log.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/**
* @file log.h
* @brief Provide access to loggigh macroses
*
**/
#ifndef LOG_H_
#define LOG_H_
#include <stdio.h>
#include <time.h>
/**
* @brief Logout INFO message
*
* @param msg[in] - formatted message to output
* @param ...[in] - additional arguments
*
**/
#define LOGINF(msg, ...) fprintf(stdout, "INF: [%08ld] ", time(NULL));\
fprintf(stdout, "%s: ", MODULE_NAME);\
fprintf(stdout, msg, ##__VA_ARGS__);\
fprintf(stdout, "\r\n")
/**
* @brief Logout ERROR message
*
* @param msg[in] - formatted message to output
* @param ...[in] - additional arguments
*
**/
#define LOGERR(msg, ...) fprintf(stderr, "ERR: [%08ld] ", time(NULL));\
fprintf(stderr, "%s: ", MODULE_NAME);\
fprintf(stderr, msg, ##__VA_ARGS__);\
fprintf(stderr, "\r\n")
#endif