public static void LogActivity(PlatformLogType activity, string description, string details = null) { #region Fire & Forget on a background thread (More overhead) /* * System.Threading.ThreadStart threadStart = delegate * { * //Log the activity * PrivateMethods.WritePlatformLog(activity, description, details); * * }; * System.Threading.Thread thread = new System.Threading.Thread(threadStart); * thread.IsBackground = true; * thread.Start(); */ #endregion #region Fire & Forget using ThreadPool.QueueUserWorkItem (Pool of threads at the ready) ThreadPool.QueueUserWorkItem(o => PrivateMethods.WritePlatformLog(activity, description, details)); #endregion }
/// <summary> /// Clear log tables/data for a particular LogType /// </summary> public static bool ClearLog(PlatformLogName platformLogTypeName) { return(PrivateMethods.ClearLog(platformLogTypeName)); }
/// <summary> /// Clear all log tables/data /// </summary> public static bool ClearLogs() { return(PrivateMethods.ClearLogs()); }
/// <summary> /// Returns all records of a particular activity in a log, newest records first /// </summary> /// <param name="activity"></param> /// <param name="maxRecords"></param> /// <returns></returns> public static IEnumerable <PlatformLogTableEntity> GetLog(PlatformLogType activity, int maxRecords) { return(PrivateMethods.GetActivityLogByTime(activity, maxRecords)); }
/// <summary> /// Returns all activities in a log, newest records first /// </summary> /// <param name="masterLog"></param> /// <returns></returns> public static IEnumerable <PlatformLogTableEntity> GetLog(PlatformLogName platformLogName, int maxRecords) { return(PrivateMethods.GetFullLogByTime(platformLogName, maxRecords)); }