diff options
Diffstat (limited to 'src/logger.cpp')
-rw-r--r-- | src/logger.cpp | 32 |
1 files changed, 20 insertions, 12 deletions
diff --git a/src/logger.cpp b/src/logger.cpp index 848dfb1..1fc2262 100644 --- a/src/logger.cpp +++ b/src/logger.cpp | |||
@@ -71,22 +71,30 @@ void Bu::Logger::setFormat( const Bu::FString &str ) | |||
71 | if( *s == '%' ) | 71 | if( *s == '%' ) |
72 | { | 72 | { |
73 | sLogFormat += '%'; | 73 | sLogFormat += '%'; |
74 | s++; | 74 | Bu::FString sBuf; |
75 | for( int l = 0;; l++ ) | 75 | for(;;) |
76 | { | 76 | { |
77 | if( fmts[l][0] == '\0' ) | 77 | s++; |
78 | int l; | ||
79 | for( l = 0;; l++ ) | ||
78 | { | 80 | { |
79 | sLogFormat += *s; | 81 | if( fmts[l][0] == '\0' ) |
80 | break; | 82 | { |
83 | sBuf += *s; | ||
84 | break; | ||
85 | } | ||
86 | else if( *s == fmts[l][0] ) | ||
87 | { | ||
88 | sLogFormat += fmts[l][2]; | ||
89 | sLogFormat += fmts[l][3]; | ||
90 | sLogFormat += '$'; | ||
91 | sLogFormat += sBuf; | ||
92 | sLogFormat += fmts[l][1]; | ||
93 | break; | ||
94 | } | ||
81 | } | 95 | } |
82 | else if( *s == fmts[l][0] ) | 96 | if( fmts[l][0] != '\0' ) |
83 | { | ||
84 | sLogFormat += fmts[l][2]; | ||
85 | sLogFormat += fmts[l][3]; | ||
86 | sLogFormat += '$'; | ||
87 | sLogFormat += fmts[l][1]; | ||
88 | break; | 97 | break; |
89 | } | ||
90 | } | 98 | } |
91 | } | 99 | } |
92 | else | 100 | else |