libsheepy

C lib for handling text files, strings and json like data structure with an object oriented system
git clone https://spartatek.se/git/libsheepy.git
Log | Files | Refs | README | LICENSE

logging.c (712B)


      1 //
      2 
      3 #include "../release/libsheepyObject.h"
      4 
      5 #define internal static
      6 
      7 
      8 #ifndef unitTest
      9 #endif
     10 int MAIN(int ARGC, char** ARGV);
     11 
     12 int argc; char **argv;
     13 
     14 #ifndef unitTest
     15 // Remove main when running the unit tests
     16 #define MAIN   main
     17 #endif
     18 int MAIN(int ARGC, char** ARGV) {
     19   int dummy UNUSED;
     20 
     21   argc = ARGC; argv = ARGV;;// logging
     22 
     23   // delete previous log
     24   pError0(rmAll("logging.log"));
     25   setLogFile("logging.log");
     26 
     27   pLog(LOG_INFO,"logging started");
     28   pLog(LOG_INFO,"logging running");
     29 
     30   setLogMode(LOG_CONCISE);
     31 
     32   pLog(LOG_WARNING,"logging concise mode");
     33 
     34   if (argc < 2) {
     35     pLog(LOG_ERROR, "logging needs more arguments");
     36     XFAILURE
     37   }
     38 
     39   pLog(LOG_CRITICAL,"logging ending with success");
     40 }