summaryrefslogtreecommitdiff
path: root/src/lib/eolian/eolian_priv.h
blob: a49e50e7f24d64396f1543768141130e489661f3 (plain)
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
38
39
40
41
#ifndef EOLIAN_PRIV_H
#define EOLIAN_PRIV_H

#include <Eina.h>
#include <stdio.h>
#include <stdarg.h>

static inline void _eolian_log_line(const char *file, int line, int column, const char *str) EINA_ARG_NONNULL(1, 4);
static inline void _eolian_log(const char *str) EINA_ARG_NONNULL(1);

static inline void
_eolian_log_line(const char *file, int line, int column, const char *str)
{
   if (!eina_log_color_disable_get())
     {
        fprintf(stderr, EINA_COLOR_RED "eolian" EINA_COLOR_RESET ": "
                EINA_COLOR_WHITE "%s" EINA_COLOR_RESET ":%d:%d: "
                EINA_COLOR_ORANGE "%s\n" EINA_COLOR_RESET,
                file, line, column, str);
     }
   else
     {
        fprintf(stderr, "eolian: %s:%d:%d: %s\n", file, line, column, str);
     }
}

static inline void
_eolian_log(const char *str)
{
   if (!eina_log_color_disable_get())
     {
        fprintf(stderr, EINA_COLOR_RED "eolian" EINA_COLOR_RESET ": "
                EINA_COLOR_ORANGE "%s\n" EINA_COLOR_RESET, str);
     }
   else
     {
        fprintf(stderr, "eolian: %s\n", str);
     }
}

#endif