Example #1
0
 private void LogInfo(string info)
 {
     if (_simpleLog == null)
     {
         _simpleLog = SimpleLogSingleton <SimpleTraceService> .Instance.Logger;
     }
     _simpleLog.LogInfo(info);
 }
Example #2
0
 private void AppendLogs(string message)
 {
     if (_log == null)
     {
         _log = SimpleLogFactory.Resolve().CreateLogFor(this);
     }
     _log.LogInfo(message);
 }
Example #3
0
 public WebApiTester(SimpleLogFactory simpleLogFactory)
 {
     //todo: refactor code
     //var response = await httpClient.GetAsync(uri).ConfigureAwait(false);
     //var handler = new HttpClientHandler { AutomaticDecompression = DecompressionMethods.GZip };
     //_httpClient = new HttpClient(handler);
     _simpleLog = simpleLogFactory.CreateLogFor(this);
 }
Example #4
0
        public static void LogEx(this ISimpleLog simpleLog, Exception ex, string message = null)
        {
            if (ex == null)
            {
                return;
            }
            var logMessage = string.Format("{0} {1}", message ?? ex.Message, Environment.NewLine + ex.StackTrace);

            simpleLog.Log(logMessage, SimpleLogLevel.Error);
        }
Example #5
0
        public AsyncLogForm()
        {
            InitializeComponent();

            var simpleLogFactory = SimpleLogFactory.Resolve();

            _simpleLog = simpleLogFactory.GetOrCreate("MockSomeLogger");

            this.cbxAutoLine.Checked = true;
            this.cbxAutoDate.Checked = true;

            MessageEventBusHelper = this.txtMessage.CreateAsyncUiHelperForMessageEventBus(message => { this.txtMessage.AppendText(message); });
        }
Example #6
0
        public DataAccessImpl(String connStr, ISimpleLog errorLog)
        {
            this.ErrorLog = errorLog;
            var connProvider = new DbConnProviderImpl_MSAccessOleDB(connStr, 20);

            Application.ApplicationExit += connProvider.Close;
            OleDB  = new DbAccessImpl(connProvider);
            Config = new ConfigProviderImpl_Orm(connProvider, "TConfig").GetConfig("SimpleVC");

            Crs = new GrpMbrDacImplV2 <EnCourseGroup, EnSubject>(this);
            Tch = new GrpMbrDacImplV2 <EnTeacherGroup, EnTeacher>(this);
            Sqd = new GrpMbrDacImplV2 <EnSquadGroup, EnSquad>(this);

            Lsn  = new LsnDacImpl(this);
            Rule = new RuleDacImpl(this);

            LoadSln();
        }
Example #7
0
        // Constructor

        public Microphone(ISimpleLog simpleLog)
        {
            _simpleLog = simpleLog;
        }
Example #8
0
 public static SimpleLogger GetLogger <T>(this ISimpleLog simpleLog)
 {
     return(simpleLog.GetLogger(typeof(T)));
 }
Example #9
0
 public static SimpleLogger GetLogger(this ISimpleLog simpleLog, Type theType)
 {
     return(simpleLog.GetLogger(theType.FullName));
 }
Example #10
0
 public static SimpleLogger GetLogger(this ISimpleLog simpleLog, string category)
 {
     return(new SimpleLogger(category, simpleLog));
 }
Example #11
0
 public SimpleLogger(string category, ISimpleLog simpleLog)
 {
     Category   = category;
     _simpleLog = simpleLog;
 }
        // Constructor

        public Microphone(ISimpleLog simpleLog)
        {
            _simpleLog = simpleLog;
        }
Example #13
0
 public static bool ShouldLog(this ISimpleLog simpleLog, SimpleLogLevel currentLevel)
 {
     return(currentLevel.ShouldLog(simpleLog.EnabledLevel));
 }
Example #14
0
 public static void Debug(this ISimpleLog simpleLog, object message)
 {
     simpleLog.Log(message, SimpleLogLevel.Debug);
 }
Example #15
0
        // Constructor

        public IdleState(ISimpleLog log)
        {
            _log = log;
        }
Example #16
0
        // Constructor

        public IdleState(ISimpleLog log)
        {
            _log = log;
        }
Example #17
0
 public MyLog(ISimpleLog simpleLog)
 {
     _simpleLog = simpleLog;
 }
Example #18
0
 public MainVo(ISimpleConfigFile simpleConfigFile, IWebApiTester webApiHelper)
 {
     SimpleConfigFile = simpleConfigFile;
     WebApiHelper     = webApiHelper;
     SimpleLog        = SimpleLogFactory.Instance.CreateLogFor(this);
 }
Example #19
0
        // Constructor

        public Speaker(ISimpleLog simpleLog)
        {
            _simpleLog = simpleLog;
        }
Example #20
0
        public static void LogEx(this ISimpleLog simpleLog, Exception ex, string message = null)
        {
            var logMessage = string.Format("{0} => {1}", message ?? ex.Message, ex.StackTrace);

            simpleLog.Log(logMessage, SimpleLogLevel.Error);
        }
Example #21
0
 public static void LogInfo(this ISimpleLog simpleLog, string message)
 {
     simpleLog.Log(message, SimpleLogLevel.Information);
 }
Example #22
0
        // Constructor

        public Bell(ISimpleLog simpleLog)
        {
            _simpleLog = simpleLog;
        }
Example #23
0
        // Constructor

        public Speaker(ISimpleLog simpleLog)
        {
            _simpleLog = simpleLog;
        }
Example #24
0
        // Constructor

        public Bell(ISimpleLog simpleLog)
        {
            _simpleLog = simpleLog;
        }