/// <summary> /// Set the directory the log files are saved to. /// This string will prefix the file name so must end with a slash or will be part of the name. /// ie: directoryPath='c:\ANT\logs' will result in files being saved to the \ANT directory named logsdevice0.txt. /// Throws an exception if directory does not exist. /// /// </summary> /// <param name="directoryPath">Path to directory to save log files in. Default is the running directory. /// This string will prefix the file name so must end with a slash or will be part of the name. /// ie: directoryPath='c:\ANT\logs' will result in files being saved to the \ANT directory named logsdevice0.txt. /// </param> public static bool setDebugLogDirectory(string directoryPath) { if (!Directory.Exists(directoryPath)) { throw new ANT_Exception("Path does not exist"); } else { return(ANT_Common.ANT_SetDebugLogDirectory(directoryPath) == 1); } }
/// <overloads>Enables debug files</overloads> /// <summary> /// Initializes and enables debug logs for all devices /// Note: For application specific logs to work properly /// (e.g. ANT-FS logs), this needs to be called BEFORE /// creating an ANT Device. /// /// </summary> public static bool enableDebugLogs() { return(ANT_Common.ANT_EnableDebugLogging() == 1); }
/// <summary> /// Returns the number of ANT USB devices currently detected by the system. /// /// </summary> public static uint getNumDetectedUSBDevices() { return(ANT_Common.ANT_GetNumDevices()); }
/// <summary> /// Adds an application specific message to the log for the current thread /// /// </summary> /// <param name="message">Message to write to the log</param> /// <returns> /// True on success /// </returns> internal static bool writeToDebugLog(string message) { return(ANT_Common.ANT_DebugThreadWrite(message) == 1); }
/// <summary> /// Creates a debug log for the currently executing thread /// /// </summary> /// <param name="name">Name of file (will result in ao_debug_name)</param> /// <returns> /// True if successful /// </returns> internal static bool initDebugLogThread(string name) { return(ANT_Common.ANT_DebugThreadInit(name) == 1); }
/// <summary> /// Disables and closes the debug logs /// /// </summary> public static void disableDebugLogs() { ANT_Common.ANT_DisableDebugLogging(); }
/// <summary> /// Initializes and enables debug logs for all devices, /// and stores the log in the specified path. /// Note: For application specific logs to work properly /// (e.g. ANT-FS logs), this needs to be called BEFORE /// creating an ANT Device. /// /// </summary> /// <param name="debugPath">Debug log directory</param> public static void enableDebugLogs(string debugPath) { ANT_Common.enableDebugLogs(); ANT_Common.setDebugLogDirectory(debugPath); }