Ejemplo 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;
            }
        }
Ejemplo n.º 2
0
 public static ILogger Create(
     IMainElapsedAction action,
     params string[] titleParts)
 {
     return(new ILogger(
                titleParts.Join(Symbol.Period),
                action
                ));
 }
Ejemplo n.º 3
0
 public ILogger(object title, IMainElapsedAction action)
     : base(title, action)
 {
 }
Ejemplo n.º 4
0
 public ILogger(IMainElapsedAction action)
     : this(null, action)
 {
 }
Ejemplo n.º 5
0
 public IntervalLogger(IMainElapsedAction action)
     : this(string.Empty, action)
 {
 }