How to log from a mod

Hi everyone,

I am trying to debug a mod I am working on, but am finding myself unable to log any debug info. I am trying to follow the old advice in this thread: How to log from your mod

In my usersettings I have
... "logging" : { "show_console" : true, "mods" : { "kai_test" : { "log_level" : 1, "kai" : 5 } } }, ...
And then in my code I have local log = radiant.log.create_logger('kai') and log:info('hello world') in my mod (which I know is being ran, at least some of the time)

I have tried this with the debug_tools mod enabled and disabled, so would appreciate any advice anyone can give!

Ah, formatting faux pas!

I think you don’t need to edit the user_setting anymore, as I do not have my mods listed and it works fine.

What I do is:

local log = radiant.log.create_logger(‘whatever’)

Then:

log:error(“something”)

And when I don’t need it anymore, I remove it so it stop spamming the log.

Right… Where would I expect to see this output? I hope this isn’t me just not realising where a console window is hiding. I have tried looking at the lau debug window (the one which is part of the debug_tools mod), the CTRL-C console, and the command prompt style window which opens along side stonehearth, all are empty

It is at the stonehearth.log file in the game folder :slight_smile:

Oh for goodness sake! :sweat_smile:

Thank you ever so much for you help, the issue is now resolved