mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-11-19 23:25:13 +00:00
new system for debug logs
This commit is contained in:
@@ -187,42 +187,6 @@ int arg::readCommon() {
|
||||
PHASE(1);
|
||||
offlineMode = true;
|
||||
}
|
||||
else if(argis("-no-stamp")) {
|
||||
debugflags &=~ DF_TIME;
|
||||
}
|
||||
else if(argis("-debf")) {
|
||||
shift();
|
||||
string s = args();
|
||||
for(char c: s) {
|
||||
for(int i=0; i<int(strlen(DF_KEYS)); i++) {
|
||||
if(DF_KEYS[i] == c) debugflags |= (1<<i);
|
||||
else if(DF_KEYS[i] == (c ^ 32)) debugflags &= ~(1<<i);
|
||||
}
|
||||
if(c >= '0' && c <= '9') {
|
||||
debugflags &= DF_TIME;
|
||||
if(c >= '1')
|
||||
debugflags |= DF_INIT | DF_WARN | DF_MSG | DF_ERROR;
|
||||
if(c >= '2')
|
||||
debugflags |= DF_GEOM | DF_GP | DF_LOG | DF_FIELD | DF_POLY;
|
||||
if(c >= '3')
|
||||
debugflags |= DF_TURN | DF_STEAM;
|
||||
if(c >= '4')
|
||||
debugflags |= DF_GRAPH | DF_MEMORY;
|
||||
}
|
||||
else if(c == '+') {
|
||||
if(debugfile) fclose(debugfile);
|
||||
shift();
|
||||
println(hlog, "writing to ", argcs());
|
||||
debugfile = fopen(argcs(), "at");
|
||||
}
|
||||
else if(c == '@') {
|
||||
if(debugfile) fclose(debugfile);
|
||||
shift();
|
||||
println(hlog, "writing to ", argcs());
|
||||
debugfile = fopen(argcs(), "wt");
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(argis("-run")) {
|
||||
PHASE(3);
|
||||
start_game();
|
||||
|
||||
Reference in New Issue
Block a user