Skip to content

Commit

Permalink
Tweak, fix scrollable logger being enabled by default
Browse files Browse the repository at this point in the history
  • Loading branch information
kartoFlane committed May 17, 2020
1 parent f8337c2 commit aa32fdc
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions scripts/mod_loader/logger.lua
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ function Logger:__init(loggerImpl)
loggerImpl:log(...)
end

self.buildCallerMessage = function(...)
return loggerImpl.buildCallerMessage(...)
self.buildCallerMessage = function(self, ...)
return loggerImpl:buildCallerMessage(...)
end
end

Expand Down
2 changes: 1 addition & 1 deletion scripts/mod_loader/logger_basic.lua
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ local function getCurrentDate()
return os.date("%Y-%m-%d %H:%M:%S")
end

function BasicLoggerImpl.buildCallerMessage(callerOffset)
function BasicLoggerImpl:buildCallerMessage(callerOffset)
callerOffset = callerOffset or 0
assert(type(callerOffset) == "number")

Expand Down
4 changes: 2 additions & 2 deletions scripts/mod_loader/mod_loader.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ local ScrollableLogger = require("scripts/mod_loader/logger_scrollable")
local BasicLoggerImpl = require("scripts/mod_loader/logger_basic")
local BufferedLoggerImpl = require("scripts/mod_loader/logger_buffered")

local useScrollableLogger = true
local useScrollableLogger = false
if useScrollableLogger then
mod_loader.logger = ScrollableLogger(BufferedLoggerImpl())
else
Expand All @@ -16,7 +16,7 @@ end
local oldLog = LOG
function LOG(...)
if mod_loader.logger then
local caller = mod_loader.logger.buildCallerMessage(1)
local caller = mod_loader.logger:buildCallerMessage(1)
mod_loader.logger:log(caller, ...)
else
oldLog(...)
Expand Down

0 comments on commit aa32fdc

Please sign in to comment.