X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=lib%2Flog.c;h=05ac58ff7a9bd18ae0bea0e45a2d059857d1feb2;hb=3cd41fca50349a2e03d5bca74fc5b38d76a4238a;hp=d8358363efa46a6637abed17b88148af97c9716f;hpb=182a15ca19841f241f35e491965a32a51598fc49;p=swftools.git diff --git a/lib/log.c b/lib/log.c index d835836..05ac58f 100644 --- a/lib/log.c +++ b/lib/log.c @@ -47,6 +47,10 @@ int getScreenLogLevel() { return screenloglevel; } +int getLogLevel() +{ + return maxloglevel; +} void setConsoleLogging(int level) { @@ -70,10 +74,10 @@ void setFileLogging(char*filename, int level, char append) } } /* deprecated */ -void initLog(char* filename, int fileloglevel, char* s00, char* s01, int s02, int screenlevel) +void initLog(char* filename, int filelevel, char* s00, char* s01, int s02, int screenlevel) { - setFileLogging(filename, fileloglevel, 0); - setConsoleLogging(screenloglevel); + setFileLogging(filename, filelevel, 0); + setConsoleLogging(screenlevel); } void exitLog() @@ -92,7 +96,7 @@ static char * logimportance[]= {"Fatal","Error","Warning","Notice","Verbose","De static int loglevels=7; static char * logimportance2[]= {" ","FATAL ","ERROR ","WARNING","NOTICE ","VERBOSE","DEBUG ", "TRACE "}; -static inline void log(const char* logString) +static inline void log_str(const char* logString) { char timebuffer[32]; char* logBuffer; @@ -171,7 +175,7 @@ static inline void log(const char* logString) { if (logFile != NULL) { - fprintf(logFile, "%s\n", logBuffer); + fprintf(logFile, "%s\r\n", logBuffer); fflush(logFile); } } @@ -187,7 +191,7 @@ void msg_str(const char* buf) if(x && (x-z)>maxloglevel) return; } - log(buf); + log_str(buf); } void msg(const char* format, ...) { @@ -206,6 +210,6 @@ void msg(const char* format, ...) vsprintf(buf, format, arglist); va_end(arglist); strcat(buf, "\n"); - log(buf); + log_str(buf); }