Here is my ErrorLog.au3 UDF which I use every day.
ErrorLog.au3 UDF is for log program activities and errors, to different output with possibility to switch output function instantly.
UDF:
#include-once
#AutoIt3Wrapper_Run_AU3Check=Y
#AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7
#Tidy_Parameters=/sort_funcs /reel
; #AutoIt3Wrapper_Run_Debug_Mode=Y
Global $__g_bUDF_ERRORLOG_FORCE_DEBUG = False
Global $__g_sUDF_ERRORL