log.h File Reference
`#include <stdio.h>`
`#include <errno.h>`
`#include <string.h>`
Include dependency graph for log.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## Macros

#define | __FILENAME__
#define | clean_errno() (errno == 0 ? "None" : strerror(errno))
#define | __log_debug_color(X) "[\x1b[1;36m" X "\x1b[0;39m]"
#define | __log_error_color(X) "[\x1b[1;31m" X "\x1b[0;39m]"
#define | __log_warn_color(X) "[\x1b[1;33m" X "\x1b[0;39m]"
#define | __log_info_color(X) "[\x1b[32m" X "\x1b[0;39m]"
#define | __log_func_color(X) "\x1b[33m" X "\x1b[39m"
#define | __log_args_color(X) "\x1b[94m" X "\x1b[39m"
#define | __log_errno_color(X) "\x1b[35m" X "\x1b[39m"
#define | log_debug(M, ...)
#define | log_error(M, ...)
#define | log_warn(M, ...)
#define | log_info(M, ...)

## Macro Definition Documentation

## __FILENAME__

#define __FILENAME__

Value:
(strrchr(__FILE__, '/') ? \
strrchr(__FILE__, '/') + 1 : __FILE__)

Definition at line 7 of file log.h.

## __log_args_color

#define __log_args_color | ( |  | X | ) | "\x1b[94m" X "\x1b[39m"

Definition at line 19 of file log.h.

## __log_debug_color

#define __log_debug_color | ( |  | X | ) | "[\x1b[1;36m" X "\x1b[0;39m]"

Definition at line 14 of file log.h.

## __log_errno_color

#define __log_errno_color | ( |  | X | ) | "\x1b[35m" X "\x1b[39m"

Definition at line 20 of file log.h.

## __log_error_color

#define __log_error_color | ( |  | X | ) | "[\x1b[1;31m" X "\x1b[0;39m]"

Definition at line 15 of file log.h.

## __log_func_color

#define __log_func_color | ( |  | X | ) | "\x1b[33m" X "\x1b[39m"

Definition at line 18 of file log.h.

## __log_info_color

#define __log_info_color | ( |  | X | ) | "[\x1b[32m" X "\x1b[0;39m]"

Definition at line 17 of file log.h.

## __log_warn_color

#define __log_warn_color | ( |  | X | ) | "[\x1b[1;33m" X "\x1b[0;39m]"

Definition at line 16 of file log.h.

## clean_errno

#define clean_errno | ( |  | ) | (errno == 0 ? "None" : strerror(errno))

Definition at line 11 of file log.h.

## log_debug

#define log_debug | ( |  | M,
|  |  | ...
| ) |  |

Definition at line 25 of file log.h.

## log_error

#define log_error | ( |  | M,
|  |  | ...
| ) |  |

Value:
fprintf(stderr, __log_error_color("ERROR") " " \
__log_func_color("%s:%-9d") \
__log_args_color(M) \
" :: " \
__log_errno_color("(errno: %s)") \
"\n", \
__FILENAME__, __LINE__, ## __VA_ARGS__, clean_errno())
__FILENAME__
#define __FILENAME__
Definition: log.h:7
__log_error_color
#define __log_error_color(X)
Definition: log.h:15
__log_errno_color
#define __log_errno_color(X)
Definition: log.h:20
__log_args_color
#define __log_args_color(X)
Definition: log.h:19
clean_errno
#define clean_errno()
Definition: log.h:11
__log_func_color
#define __log_func_color(X)
Definition: log.h:18

Definition at line 35 of file log.h.

## log_info

#define log_info | ( |  | M,
|  |  | ...
| ) |  |

Value:
fprintf(stderr, __log_info_color("INFO") " " \
__log_func_color("%4s:%-9d") \
__log_args_color(M) "\n", \
__FILENAME__, __LINE__, ## __VA_ARGS__)
__FILENAME__
#define __FILENAME__
Definition: log.h:7
__log_args_color
#define __log_args_color(X)
Definition: log.h:19
__log_info_color
#define __log_info_color(X)
Definition: log.h:17
__log_func_color
#define __log_func_color(X)
Definition: log.h:18

Definition at line 54 of file log.h.

## log_warn

#define log_warn | ( |  | M,
|  |  | ...
| ) |  |

Value:
fprintf(stderr, __log_warn_color("WARN") " " \
__log_func_color("%s:%-9d") \
__log_args_color(M) \
" :: " \
__log_errno_color("(errno: %s)") \
"\n", \
__FILENAME__, __LINE__, ## __VA_ARGS__, clean_errno())
__FILENAME__
#define __FILENAME__
Definition: log.h:7
__log_errno_color
#define __log_errno_color(X)
Definition: log.h:20
__log_args_color
#define __log_args_color(X)
Definition: log.h:19
clean_errno
#define clean_errno()
Definition: log.h:11
__log_warn_color
#define __log_warn_color(X)
Definition: log.h:16
__log_func_color
#define __log_func_color(X)
Definition: log.h:18

Definition at line 45 of file log.h.