// debug.inc - debug functions

//
// Initializes debug output variables
//
[DebugStart]
   read-syms GlobalConstants
   read-syms GlobalRegistryConstants

   set !DebugOutputControl = 1
   set !DIGI_DebugLevel = DEBUG_LEVEL_TRACE     // start out pretty verbose

   _Enter("DebugStart", "")

   _OpenRegKey_HKLM($(KEY_DIGIROOT)"\\INF", KeyInf)
   _IfNotValidKey($(KeyInf))
      goto Exit
   endif

	_GetRegDwordByKey $(KeyInf) "DebugLevel"
   _If ($($R0))
      set !DIGI_DebugLevel = $($R1)
   endif

Exit = +
   _Always("DebugStart", _Show(!DIGI_DebugLevel))

   CloseRegKey $(KeyInf)

   _Exit("DebugStart", "")
   Return
