Changeset 2082 for box/trunk/infrastructure/buildenv-testmain-template.cpp
- Timestamp:
- 31/01/2008 23:52:08 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
box/trunk/infrastructure/buildenv-testmain-template.cpp
r2013 r2082 161 161 162 162 #ifdef HAVE_GETOPT_H 163 #ifdef NDEBUG 164 int logLevel = Log::NOTICE; // need an int to do math with 165 #else 166 int logLevel = Log::INFO; // need an int to do math with 167 #endif 168 163 169 struct option longopts[] = 164 170 { … … 171 177 int ch; 172 178 173 while ((ch = getopt_long(argc, argv, "c:d: s:t:TUV", longopts, NULL))179 while ((ch = getopt_long(argc, argv, "c:d:qs:t:vTUV", longopts, NULL)) 174 180 != -1) 175 181 { … … 203 209 break; 204 210 211 case 'q': 212 { 213 if(logLevel == Log::NOTHING) 214 { 215 BOX_FATAL("Too many '-q': " 216 "Cannot reduce logging " 217 "level any more"); 218 return 2; 219 } 220 logLevel--; 221 } 222 break; 223 224 case 'v': 225 { 226 if(logLevel == Log::EVERYTHING) 227 { 228 BOX_FATAL("Too many '-v': " 229 "Cannot increase logging " 230 "level any more"); 231 return 2; 232 } 233 logLevel++; 234 } 235 break; 236 237 case 'V': 238 { 239 logLevel = Log::EVERYTHING; 240 } 241 break; 242 205 243 case 't': 206 244 { … … 219 257 Console::SetShowTime(true); 220 258 Console::SetShowTimeMicros(true); 221 }222 break;223 224 case 'V':225 {226 Logging::SetGlobalLevel(Log::EVERYTHING);227 259 } 228 260 break; … … 243 275 } 244 276 } 277 278 Logging::SetGlobalLevel((Log::Level)logLevel); 245 279 246 280 argc -= optind - 1;
Note: See TracChangeset
for help on using the changeset viewer.
