summaryrefslogtreecommitdiff
path: root/map65/libm65/debug_log.f90
diff options
context:
space:
mode:
Diffstat (limited to 'map65/libm65/debug_log.f90')
-rw-r--r--map65/libm65/debug_log.f904
1 files changed, 3 insertions, 1 deletions
diff --git a/map65/libm65/debug_log.f90 b/map65/libm65/debug_log.f90
index 6b6a39e7..d91b969b 100644
--- a/map65/libm65/debug_log.f90
+++ b/map65/libm65/debug_log.f90
@@ -2,6 +2,7 @@ module debug_log
implicit none
integer, save :: dbg_unit = -1
logical, save :: dbg_opened = .false.
+ logical, save :: dbg_enabled = .false. ! master switch; set .true./.false. from run_m65 to enable/disable all dbg() output
contains
subroutine ensure_log_open()
if (.not. dbg_opened) then
@@ -10,9 +11,10 @@ contains
dbg_opened = .true.
end if
end subroutine ensure_log_open
-
+
subroutine dbg(msg)
character(len=*), intent(in) :: msg
+ if (.not. dbg_enabled) return
call ensure_log_open()
write(dbg_unit,'(A)') trim(msg)
flush(dbg_unit)