Why not pass it as a parameter instead? UDFs work in a way that all variable should be declared prior to the user implementing it in their script. If you don't want to "clog" up the _CW parameters, then you could something like this >> (though not recommended)
#include-once
#include <FileConstants.au3>
Global $__sCWLogFile = @ScriptDir & '\LogFile.log' ; Default log file variable placed at the top of the UDF.
; A user just has to call the relevant function.
Func _CW_GetLogFile()
Return $__sCWLogFile
EndFunc ;==>_CW_GetLogFile
Func _CW_SetLogFile($sLogFile)
If FileExists($sLogFile) = 0 Then
FileClose(FileOpen($sLogFile, $FO_OVERWRITE)) ; Create the file if it doesn't exist.
EndIf
$__sCWLogFile = $sLogFile
EndFunc ;==>_CW_SetLogFile