/[pdpsoft]/trunk/grid-mw-security/ees/src/nextgen/ng_log.c
ViewVC logotype

Contents of /trunk/grid-mw-security/ees/src/nextgen/ng_log.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 808 - (show annotations) (download) (as text)
Thu Sep 17 12:11:56 2009 UTC (12 years, 4 months ago) by aramv
File MIME type: text/x-chdr
File size: 641 byte(s)
Tried to fix incorrect va_arg usage
1 #include "eef.h"
2 #include <time.h>
3 EES_RC ng_log(int priority, const char* format, ...){
4 va_list args;
5 time_t _time;
6 struct tm * _time_s;
7 char _strf_fmt[MAX_TIME_STRING_SIZE];
8
9 _time = time(NULL);
10 _time_s = localtime(&_time);
11 strftime(_strf_fmt, MAX_TIME_STRING_SIZE, "%G", _time_s);
12
13 va_start(args, format);
14 if(priority == LOG_ERR){
15 vfprintf(stderr, format, args);
16 }
17 va_end(args);
18 #if ENABLE_DEBUG
19 va_start(args, format);
20 if(priority == LOG_DEBUG){
21 vfprintf(stdout, format, args);
22 }
23 va_end(args);
24 #endif
25 va_start(args, format);
26 vsyslog(priority, format, args);
27 va_end(args);
28 return 0;
29 }

grid.support@nikhef.nl
ViewVC Help
Powered by ViewVC 1.1.28