Log Output
This page describes how to log information from a WinTAK plugin. Developing a WinTAK plugin requires sometimes to have an overview of what the plugin currently doing. There are several ways to print information from the current implementation. From C# basic to WinTAK Logger.
Contents
Visual Studio Output
On of the first entrypoint to debug code is to use one of the most common C# basic method to display it into Visual Studio Code :
System.Diagnostics.Debug.WriteLine("Hello World!");
This method provides an output log into Visual Studio debug output window.
WinTAK Framework Logs
As explained in the WinTAK Quick Setup, WinTAK have a %APPDATA%/WinTAK/Logs where logging information is recorded when WinTAK is running. The logging text file is also a result of the debug window in Visual Studio.
The %APPDATA%/WinTAK/Logs contains a series of pre-formatted files which are : {Log/Errors/Fatal}-WinTAK-yyyy-mm-dd.txt
WinTAK Logger
This section describe the ILogger interface which is defined in WinTak.Framework. This Interface provide the possibility to directly logging into the WinTak Logs folder.
using WinTak.Framework;
..
public ILogger _logger;
[ImportingConstructor]
public THeFaboulousClassNameConstructor(ILogger logger)
{
_logger = logger;
_logger.Debug("Log a Debug message!");
}
public void TheFaboulousMethod() {
_logger.Debug("Log a Debug message!");
}
The possibilities of ILogger are :
ILogger.Debugfor DEBUG with the possibility to extendExceptionILogger.Errorfor ERROR with the possibility to extendExceptionILogger.Fatalfor FATAL with the possibility to extendExceptionILogger.Infofor INFO with the possibility to extendExceptionILogger.Warnfor WARNING with the possibility to extendException
WinTAK Log
This section describe the Log Class which is the same as ATAK developer already use. This class :
using MapEngine.Interop.Util;
..
internal const string TAG = "TheFaboulousClassName"
..
public void AnyMethod(string msg) {
Log.d(TAG, "log a Debug message");
}
The possibilities of logs are :
Log.dfor DEBUG message with the possibility to extendSystem::ExceptionLog.efor ERROR message message with the possibility to extendSystem::ExceptionLog.ifor INFO message message with the possibility to extendSystem::ExceptionLog.wfor WARNING message message with the possibility to extendSystem::Exception