Esempio n. 1
0
        public IntervalLogger(object title, IMainElapsedAction action)
            : base()
        {
            this.Record = new LogRecord();
            //var t = title.ToStringX();
            //if(!t.NullOrEmpty()) { this.Record.Title = t; }
            //if(null != action) { this.Action = action; }

            // Tid
            //ScopeContext.Current.Scope.Tid = this.Record.Tid;

            // MethodBase
            var sf = RunTime.CalleeStackFrameBeyond("Log");

            if (null != sf)
            {
                this.Method       = sf.GetMethod();
                this.Record.Path  = this.Method.Path();
                this.Record.Title =
                    this.Record.Title.NullOrEmpty()
                    ||
                    this.Record.Title.Contains("IntervalLogger")
                                                ? this.Method.Description()
                                                : this.Record.Title;
                this.Record.Method = this.Method;
            }
        }
Esempio n. 2
0
 public static ILogger Create(
     IMainElapsedAction action,
     params string[] titleParts)
 {
     return(new ILogger(
                titleParts.Join(Symbol.Period),
                action
                ));
 }
Esempio n. 3
0
 public ILogger(object title, IMainElapsedAction action)
     : base(title, action)
 {
 }
Esempio n. 4
0
 public ILogger(IMainElapsedAction action)
     : this(null, action)
 {
 }
Esempio n. 5
0
 public IntervalLogger(IMainElapsedAction action)
     : this(string.Empty, action)
 {
 }