\hypertarget{eina_log_02_8c-example}{}\section{eina\+\_\+log\+\_\+02.\+c}

\begin{DoxyCodeInclude}
\textcolor{comment}{//Compile with:}
\textcolor{comment}{//gcc -Wall -o eina\_log\_02 eina\_log\_02.c `pkg-config --cflags --libs eina`}

\textcolor{preprocessor}{#include <stdlib.h>}
\textcolor{preprocessor}{#include <stdio.h>}

\textcolor{preprocessor}{#include <\mbox{\hyperlink{Eina_8h}{Eina.h}}>}

\textcolor{keywordtype}{void} test(\textcolor{keywordtype}{int} i)
\{
   \mbox{\hyperlink{group__Eina__Log__Group_ga09b88349373c2158f988d72375af5849}{EINA\_LOG\_DBG}}(\textcolor{stringliteral}{"Entering test"});

   \textcolor{keywordflow}{if} (i < 0)
     \{
         \mbox{\hyperlink{group__Eina__Log__Group_ga2e33caeeeb6051526c01b7fea4d6c91b}{EINA\_LOG\_ERR}}(\textcolor{stringliteral}{"Argument is negative"});
         \textcolor{keywordflow}{return};
     \}

   \mbox{\hyperlink{group__Eina__Log__Group_gafb145e82df0f9441244832c94e87a21b}{EINA\_LOG\_INFO}}(\textcolor{stringliteral}{"argument non negative"});

   \mbox{\hyperlink{group__Eina__Log__Group_ga09b88349373c2158f988d72375af5849}{EINA\_LOG\_DBG}}(\textcolor{stringliteral}{"Exiting test"});
\}

\textcolor{keywordtype}{int} main(\textcolor{keywordtype}{void})
\{
   \textcolor{keywordflow}{if} (!\mbox{\hyperlink{group__Eina__Main__Group_gafee4bfc0e509b6ffed6598edf6f4b3de}{eina\_init}}())
     \{
         printf(\textcolor{stringliteral}{"log during the initialization of Eina\_Log module\(\backslash\)n"});
         \textcolor{keywordflow}{return} EXIT\_FAILURE;
     \}

   \mbox{\hyperlink{group__Eina__Log__Group_ga018457ec82c2e428600d1023d4b92749}{eina\_log\_level\_set}}(\mbox{\hyperlink{group__Eina__Log__Group_gga326699509b2e7578ace7c0a15b4a8c1aafdc5a5cfb78f5e4d5851447ed798af50}{EINA\_LOG\_LEVEL\_DBG}});

   test(-1);
   test(0);

   \mbox{\hyperlink{group__Eina__Main__Group_ga2c8b4020427108a30c44707af22c99d3}{eina\_shutdown}}();

   \textcolor{keywordflow}{return} EXIT\_SUCCESS;
\}
\end{DoxyCodeInclude}
 