about summary refs log tree commit diff stats
path: root/src/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.c')
-rwxr-xr-xsrc/main.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c
index 0f770db6..7baba053 100755
--- a/src/main.c
+++ b/src/main.c
@@ -62,6 +62,7 @@ int arm64_atomics = 0;
 int box64_dynarec = 0;
 #endif
 int dlsym_error = 0;
+int cycle_log = 0;
 #ifdef HAVE_TRACE
 int trace_xmm = 0;
 int trace_emm = 0;
@@ -351,6 +352,19 @@ void LoadLogEnv()
         if(!box64_nobanner)
             printf_log(LOG_INFO, "Debug level is %d\n", box64_log);
     }
+    p = getenv("BOX64_ROLLING_LOG");
+    if(p) {
+        if(strlen(p)==1) {
+            if(p[0]>='0' && p[0]<='1')
+                cycle_log = p[0]-'0';
+        }
+        if(cycle_log && box64_log>LOG_INFO) {
+            cycle_log = 0;
+            printf_log(LOG_NONE, "Incompatible Rolling log and Debug Log, disabling Rolling log\n");
+        }
+    }
+    if(!box64_nobanner && cycle_log)
+        printf_log(LOG_INFO, "Rolling log, showing last %d function call on signals\n", CYCLE_LOG);
     p = getenv("BOX64_DUMP");
     if(p) {
         if(strlen(p)==1) {