aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/libraries/eina/src/examples/eina_log_02.c
blob: a056729b2d26bc930a4fff79daa3ce4c9e4b1d6f (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
//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;
     }

   test(-1);
   test(0);

   eina_shutdown();

   return EXIT_SUCCESS;
}