/// <summary> /// When you new up a TaskBasedStateMachine, it's log information will be saved in a /// "TaskBasedStateMachineLog.log" file under the current application directory. /// </summary> public TaskBasedStateMachine() : base() { List <int> list = new List <int>(); // Setup Configuration LoggerManagerConfiguration.SaveDebugFile = TaskBasedStateMachineLibraryConfiguration.SaveDebugFile; // Setup Configuration LoggerManagerConfiguration.OverrideDebugFile = TaskBasedStateMachineLibraryConfiguration.OverrideDebugFile; // Initialize the logger TaskBasedStateMachineLogger.InitiateLogger(); // Use the file logger for debug message BasicLogger.Construct().UseFileLogger(@".\TaskBasedStateMachineLog.log"); // Initialize task dictionary mTasks = new Dictionary <string, Func <TParam, TParam> >() { { InitialTask, null }, { ExceptionTask, null }, { UnhandledExceptionTask, null } }; // Register the error from the helper GraphvizHelper.OnErrorOccurs += GraphvizHelper_OnErrorOccurs; }
private void UseBasicLogger() { // Test for basic logger BasicLogger.Construct() .UseFileLogger(@".\test.txt") .UseCustomFunctionAsyncLogger(msg => MessageBox.Show(msg)) .Build(); BasicLogger.ErrorOccurs += BasicLogger_ErrorOccurs; }