feat: FileLogger. A small utility to log to a file identified by proc…#481
feat: FileLogger. A small utility to log to a file identified by proc…#481jeffreyrainy merged 4 commits intodevelopfrom
Conversation
…ess ID. Useful when running multiple instances locally
| ~FileLogger() | ||
| { | ||
| writer.Close(); | ||
| } |
There was a problem hiding this comment.
I agree with the dispose.
But not with the AutoFlush. Since this is debug functionality, you want the info to get out asap. You might be stopped on a breakpoint soon after, or get other crash/exceptions. Auto-flushing comes at very little cost and provides peace-of-mind that you'll get your logs.
|
Would this maybe be something which we want to put in the community-contributions repository instead of core MLAPI? Because it's not really related to MLAPI directly but more like a separate extension. |
I could agree, but what I'm after, here, is not just having a tool for myself. I'm trying to get a common set of tools that are already there and ready. So, for example, if there's a discussion between two developers and they want to test which approach is better, either one can just drop in a I'd totally buy "This doesn't belong in mlapi" and would keep it local for me. I'd accept this, no issue. |
mattwalsh-unity
left a comment
There was a problem hiding this comment.
For reference, here's another similar utility class https://github.com/hk1ll3r/UnityObjectLoggerExt
In particular
https://github.com/hk1ll3r/UnityObjectLoggerExt/blob/master/Assets/Scripts/UnityObjectLoggerExt.cs
…ess ID. Useful when running multiple instances locally