summaryrefslogtreecommitdiff
path: root/src/logger.cpp
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2007-07-10 00:32:36 +0000
committerMike Buland <eichlan@xagasoft.com>2007-07-10 00:32:36 +0000
commit22e51abaebd4f0c194e505d879f9b6a2fc31890d (patch)
tree25b57bfbc04af4a772516983d926f3858fe0cd61 /src/logger.cpp
parent2de3693dd24463c5a02b9308ddfd674f58bac7c1 (diff)
downloadlibbu++-22e51abaebd4f0c194e505d879f9b6a2fc31890d.tar.gz
libbu++-22e51abaebd4f0c194e505d879f9b6a2fc31890d.tar.bz2
libbu++-22e51abaebd4f0c194e505d879f9b6a2fc31890d.tar.xz
libbu++-22e51abaebd4f0c194e505d879f9b6a2fc31890d.zip
Fixed a bunch of stuff, I don't even know what...
Diffstat (limited to '')
-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 );