Hi!
The way the log works is you create a log at the top of the file, and then you have to specify the level of the log, and then listen to that log’s level in your users settings.
Ex:
local log = radiant.log.create_logger(‘my_log_name’)
local MyClass = class()
function MyClass:func(arg_1)
log:detail(“calling func with arg_1: %s”, arg_1)
end
THEN, in your user_settings.json, add a logging section
"logging" : {
“mods” : {
“my_mod” : {
“my_log_name”: 9
}
}
}
The log level numbers are:
ERROR = 1,
WARNING = 3,
INFO = 5,
DEBUG = 7,
DETAIL = 8,
SPAM = 9,
The number you put into your user_settings.json file is the highest log level that will be printed out into stonehearth.log. Ex: putting the number 9 means you’ll get all errors, warnings, info, debug, detail, and spam. Meanwhile, putting 3 means you’ll only get errors and warnings.
Hope this helps
Let me know if you run into any issues.
-Yang