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