File: helloworld.c

package info (click to toggle)
log4c 1.2.4-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,872 kB
  • sloc: sh: 11,246; ansic: 8,645; makefile: 682; lex: 134; cpp: 6
file content (27 lines) | stat: -rw-r--r-- 530 bytes parent folder | download | duplicates (3)
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
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#include <stdio.h>

#include "log4c.h"

int main(int argc, char** argv){
  int rc = 0;
  log4c_category_t* mycat = NULL;
  
  if (log4c_init()){
    printf("log4c_init() failed");
    rc = 1;  
  }else{
      mycat = log4c_category_get("log4c.examples.helloworld");

      log4c_category_log(mycat, LOG4C_PRIORITY_ERROR, "Hello World!");
    
    /* Explicitly call the log4c cleanup routine */
    if ( log4c_fini()){
      printf("log4c_fini() failed");
    }
  }
  return rc;
}