Skip to content

Commit 2699dda

Browse files
author
Marcus E. W. Germano, IV
committed
Fixed debug hooks
* Debug hooks now just take a printable object instead of a `string.format` signature.
1 parent dbf407f commit 2699dda

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

eturtle.lua

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,23 @@ local eturtle = {} do
1515
local position, bearing, equipment = nil, nil, nil
1616

1717
--[[ Debugging Variables and Functions ]]--
18-
local function defaultPrintHook(format, ...)
19-
print(string.format(format, ...))
18+
local function defaultPrintHook(message)
19+
print(message)
2020
end
21-
local function defaultErrorHook(format, ...)
22-
printError(string.format(format, ...))
21+
local function defaultErrorHook(message)
22+
printError(message)
2323
end
2424
local debug, debugPrintHook, debugErrorHook = false, defaultPrintHook, defaultErrorHook
2525
local function debugPrint(format, ...)
2626
if debug then
27-
debugPrintHook(format, ...)
27+
local message = string.format(format, ...)
28+
debugPrintHook(message)
2829
end
2930
end
3031
local function debugError(format, ...)
3132
if debug then
32-
debugErrorHook(format, ...)
33+
local message = string.format(format, ...)
34+
debugErrorHook(message)
3335
end
3436
end
3537

0 commit comments

Comments
 (0)