summaryrefslogtreecommitdiff
path: root/src/logger.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/logger.cpp')
-rw-r--r--src/logger.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/logger.cpp b/src/logger.cpp
index aedfe0f..8c058d1 100644
--- a/src/logger.cpp
+++ b/src/logger.cpp
@@ -5,6 +5,7 @@
5 5
6Bu::Logger::Logger() 6Bu::Logger::Logger()
7{ 7{
8 setFormat("%t");
8} 9}
9 10
10Bu::Logger::~Logger() 11Bu::Logger::~Logger()
@@ -27,7 +28,7 @@ void Bu::Logger::log( int nLevel, const char *sFile, const char *sFunction, int
27 char *line = NULL; 28 char *line = NULL;
28 struct tm *pTime; 29 struct tm *pTime;
29 pTime = localtime( &t ); 30 pTime = localtime( &t );
30 asprintf( 31 if ( asprintf(
31 &line, 32 &line,
32 sLogFormat.getStr(), 33 sLogFormat.getStr(),
33 pTime->tm_year+1900, 34 pTime->tm_year+1900,
@@ -41,7 +42,11 @@ void Bu::Logger::log( int nLevel, const char *sFile, const char *sFunction, int
41 nLine, 42 nLine,
42 text, 43 text,
43 sFunction 44 sFunction
44 ); 45 ) < 0 )
46 {
47 //printf("LOGGER: ERROR ALLOCATING STRING: %s\n", strerror( errno ) );
48 return;
49 }
45 write( fileno(stdout), line, strlen(line) ); 50 write( fileno(stdout), line, strlen(line) );
46 free( text ); 51 free( text );
47 free( line ); 52 free( line );