mirror of
https://gitlab.com/hoggit/developers/hoggit.git
synced 2025-11-10 15:43:28 +00:00
Made some changes to logging for dist version vs debug version
This commit is contained in:
parent
4312f998c4
commit
f6a341a811
@ -1,15 +1,19 @@
|
||||
--- Logging.lua
|
||||
-- Logging utility for HOGGIT framework
|
||||
|
||||
-- Open a log file for use
|
||||
logFile = io.open(HOGGIT.log_base..[[\HOGGIT.log]], "w")
|
||||
if HOGGIT.debug then
|
||||
-- Open a log file for use
|
||||
logFile = io.open(HOGGIT.log_base..[[\HOGGIT.log]], "w")
|
||||
end
|
||||
|
||||
--- Write a string to the logfile
|
||||
-- @param str The string to write to the log
|
||||
function log(str)
|
||||
if str == nil then str = 'nil' end
|
||||
if logFile then
|
||||
if HOGGIT.debug and logFile then
|
||||
logFile:write("HOGGIT --- " .. str .."\r\n")
|
||||
logFile:flush()
|
||||
else
|
||||
env.info("HOGGIT --- " .. str .. "\r\n")
|
||||
end
|
||||
end
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user