| 1 |
#ifndef LOG_H |
| 2 |
#define LOG_H |
| 3 |
|
| 4 |
#include <stdio.h> |
| 5 |
|
| 6 |
static inline void log_internal(const char *type, const char *msg, const char *param_str, int param_int) |
| 7 |
{ |
| 8 |
if (!param_str && !param_int) { |
| 9 |
printf("%s: %s\n", type, msg); |
| 10 |
} else if (param_str && !param_int) { |
| 11 |
printf("%s: %s %s\n", type, msg, param_str); |
| 12 |
} else if (!param_str && param_int) { |
| 13 |
printf("%s: %s %d\n", type, msg, param_int); |
| 14 |
} else { |
| 15 |
printf("%s: %s %s %d\n", type, msg, param_str, param_int); |
| 16 |
} |
| 17 |
} |
| 18 |
|
| 19 |
const char *config_get_string(int key) |
| 20 |
{ |
| 21 |
return 0; |
| 22 |
} |
| 23 |
|
| 24 |
void log_info(const char *msg, const char *param_str, int param_int) |
| 25 |
{ |
| 26 |
log_internal("Info", msg, param_str, param_int); |
| 27 |
} |
| 28 |
|
| 29 |
void log_error(const char *msg, const char *param_str, int param_int) |
| 30 |
{ |
| 31 |
log_internal("ERROR", msg, param_str, param_int); |
| 32 |
} |
| 33 |
|
| 34 |
#endif // LOG_H |