-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdemoDebugger.lua
More file actions
52 lines (41 loc) · 2.38 KB
/
demoDebugger.lua
File metadata and controls
52 lines (41 loc) · 2.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
require '_cliSugar'
require '_testData'
require 'fs22Logger'
printWarning("Demo Script - Enhanced FS22 Logger")
print("-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-")
local myLoggerVanilla = FS22Log:new(
"demoSample",
FS22Log.DEBUG_MODE.VERBOSE
)
-- yourLogger:print(text, logLevel, filter)
-- yourLogger.printVariable(output, logLevel, filter, depthLimit, prefix, searchTerms)
local testVarString = "Hello There."
myLoggerVanilla:print("Test String", nil, "test_string")
myLoggerVanilla:printVariable(undefinedVar, nil, "undefined_variable")
myLoggerVanilla:printVariableIsTable(undefinedVar, nil, "undefined_variable_is_table")
myLoggerVanilla:printVariable(testVarString, nil, "test_string_variable")
myLoggerVanilla:printVariableIsTable(testVarString, nil, "test_string_variable_is_table")
myLoggerVanilla:printVariable(DemoSampleData, nil, "sample_data", 3)
myLoggerVanilla:printVariable(DemoSampleData, nil, "sample_data_search_fail", 4, nil, {"badArgument!"})
myLoggerVanilla:printVariable(DemoSampleData, nil, "sample_data_search", 4, nil, {{"batter", "Chocolate"}, FS22Log.SEARCH.VALUES})
-- this one prints
myLoggerVanilla:printVariableIfChanged(DemoSampleData, nil, "sample_data_search_once", 4, nil, {{"batter", "Chocolate"}, FS22Log.SEARCH.VALUES})
-- this one skips
myLoggerVanilla:printVariableIfChanged(DemoSampleData, nil, "sample_data_search_once", 4, nil, {{"batter", "Chocolate"}, FS22Log.SEARCH.VALUES})
table.insert(DemoSampleData, {"hello"})
--this one prints
myLoggerVanilla:printVariableIfChanged(DemoSampleData, nil, "sample_data_search_once", 4, nil, {{"batter", "Chocolate"}, FS22Log.SEARCH.VALUES})
-- this one skips
myLoggerVanilla:printVariableIfChanged(DemoSampleData, nil, "sample_data_search_once", 4, nil, {{"batter", "Chocolate"}, FS22Log.SEARCH.VALUES})
-- function AddTest(a, b)
-- print("Original AddTest called: " .. tostring(a) .. " + " .. tostring(b) .. " = " .. tostring(a+b))
-- end
-- function SubTest(a, b)
-- print("Original SubTest called: " .. tostring(a) .. " - " .. tostring(b) .. " = " .. tostring(a-b))
-- end
-- InvalidFunction = FS22LogFunction(FS22Log.DEBUG_MODE.DEVEL, "demoSample", "InvalidFunction", InvalidFunction)
-- AddTest = FS22LogFunction(FS22Log.DEBUG_MODE.DEVEL, "demoSample", "AddTest", AddTest)
-- SubTest = FS22LogFunction(FS22Log.DEBUG_MODE.WARNINGS, "demoSample", "SubTest", SubTest)
-- InvalidFunction()
-- AddTest(1, 2)
-- SubTest(5, 1)