1
0
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:
Zeno Rogue
2025-10-19 15:47:01 +02:00
parent 94024dd5f1
commit 113e75d5e1
43 changed files with 601 additions and 447 deletions

View File

@@ -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();