Skip to content

Commit

Permalink
Fixed log writing when log.write was not available
Browse files Browse the repository at this point in the history
  • Loading branch information
Quaggles committed May 24, 2023
1 parent 50d406f commit 22ee7ba
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions Hooks/DCS-LuaExporter-hook.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
local logName = 'DCS.Lua.Exporter'
local function debugLog(message) log.write(logName, log.INFO, tostring(message)) end
local function debugLogError(message) log.write(logName, log.ERROR, tostring(message)) end
local function debugLog(message)
if log.write ~= nil then
log.write(logName, log.INFO, message)
else
net.log("["..logName.."] ".."(INFO) "..message)
end
end
local function debugLogError(message)
if log.write ~= nil then
log.write(logName, log.ERROR, message)
else
net.log("["..logName.."] ".."(ERROR) "..message)
end
end
local originalPackagePath = package.path
package.path = package.path..";"..lfs.writedir().."Scripts/Hooks/?.lua" -- Saved Games Hooks
package.path = package.path..";./Scripts/Hooks/?.lua" -- Game Directory Hooks
Expand Down

0 comments on commit 22ee7ba

Please sign in to comment.