File Logger
With the latest update I have added a custom file logger, which you can create in your code and save the logging results to your custom folder.
Last updated
With the latest update I have added a custom file logger, which you can create in your code and save the logging results to your custom folder.
Last updated
Let's create a logger with name TestLogger
This modded script should be created in Module #3 - 3_Game, so you can access that across the whole app. Otherwise you can choose a different place. I just think it's convenient to have it accessible from most of the codebase of DayZ Server.
Congratulations, you have create your logger The file will be saved in $profile/CRDTN/Logs/TestLogger.log
If you want a different location for your logs, you must rewrite the constant
Now you can access it from your code wherever you need by using the following code snippet.
You can also cache the reference for more convenient work like below.
If you have followed the code above, you now can just call in the code
Be aware, that the example showcases usage of PluginBase which is part of module #4 so you can use the GetLogger() method only within module #4 and #5.