Separate engine and modules error logs

Moderator: Moderator

Post Reply
Message
Author
Grey
Loremaster
Posts: 3517
Joined: Thu Sep 23, 2010 10:18 pm
Location: London, England
Contact:

Separate engine and modules error logs

#1 Post by Grey »

As per title. Sometimes it can be hard finding the relevant module output between all the engine loading stuff. Or perhaps suppress the output for the boot module, since it all seems to work fine anyway.
http://www.gamesofgrey.com - My own T-Engine games!
Roguelike Radio - A podcast about roguelikes

tiger_eye
Perspiring Physicist
Posts: 889
Joined: Thu Feb 17, 2011 5:20 am

Re: Separate engine and modules error logs

#2 Post by tiger_eye »

Grey, I suggest making the output of your module grep-able from the main log. Make your own module print function as below:

Code: Select all

mprint = function(...)
    print("[MY_MODULE]", ...)
end
and use "mprint" in your module instead of "print". This allows you to do `grep '[MY_MODULE]' te4_log.txt` to see all the module-related output.

Grey
Loremaster
Posts: 3517
Joined: Thu Sep 23, 2010 10:18 pm
Location: London, England
Contact:

Re: Separate engine and modules error logs

#3 Post by Grey »

And what the frell is grep?

(Actually I sorta know what it is, and quite specifically know it's not available to me.)
http://www.gamesofgrey.com - My own T-Engine games!
Roguelike Radio - A podcast about roguelikes

reverend
Wayist
Posts: 27
Joined: Fri Sep 16, 2011 11:54 am

Re: Separate engine and modules error logs

#4 Post by reverend »

grep outputs (in this case) just the lines that meet the condition. On Windows, you can use an editor like Notepad++ - it's search-in-files function works quite similar, if a bit uglier.


Post Reply