Closed Sheep-y closed 5 years ago
You can use the game's logger to reuse the central logfile. I do it for all my mods.
var logger = HBS.Logging.Logger.GetLogger(Name) logger.Log("hello world");
BATTLETECH\BattleTech_Data\output_log.txt
But does ModTek use it? Isn't it better to keep game log to game and mod to mod log in mod folder?
If mod has uncatched exceptions those can appear in game log anyway... So best put everything there to be sure.
See #9 for a related issue.
Ah. I see. So that is where uncaught exception goes. I just catch almost everything so that my mod have a less chance to break the game when it fails (eventually). Yes. Redirecting to game log seems to be a very good idea.
@Mpstark I still wish the Logger can be made public if only to offer more options, but it you don't wish that you may close this ticket.
In my mod I logs info like settings, patched methods, or errors thrown into a custom log file that is mod specific.
Can we borrow ModTek's Logger? Things like Exception dump is perhaps better logged with ModTek so that all errors are in one place. If you add log level and lazy string format I'll happily migrate all the logging over too!