summaryrefslogtreecommitdiff
path: root/src/examples/eina/eina_log_02.c
blob: e2d5a9f8938bb9897b9aaab665967f028839a69e (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
//Compile with:
//gcc -Wall -o eina_log_02 eina_log_02.c `pkg-config --cflags --libs eina`

#include <stdlib.h>
#include <stdio.h>

#include <Eina.h>

void test(int i)
{
   EINA_LOG_DBG("Entering test");

   if (i < 0)
     {
         EINA_LOG_ERR("Argument is negative");
         return;
     }

   EINA_LOG_INFO("argument non negative");

   EINA_LOG_DBG("Exiting test");
}

int main(void)
{
   if (!eina_init())
     {
         printf("log during the initialization of Eina_Log module\n");
         return EXIT_FAILURE;
     }

   eina_log_level_set(EINA_LOG_LEVEL_DBG);

   test(-1);
   test(0);

   eina_shutdown();

   return EXIT_SUCCESS;
}