예제 #1
0
 public LogTrace(object scope, LogTrace next, string reason)
 {
     if (!status.log)
     {
         throw new InvEx("Logging is disabled");
     }
     this.scope       = scope.ToString();
     this.isDecorator = scope is IDecorator;
     this.next        = next;
     this.reason      = TraceFormat.ReasonField(reason);
 }
예제 #2
0
 public bool Matches(object scope, string reason)
 => (this.scope?.ToString()).Equals(scope) &&
 this.reason == TraceFormat.ReasonField(reason);
예제 #3
0
 [Test] public void BadReason()
 {
     Assert.Throws <ArgEx>(() => F.ReasonField("(parens)"));
 }
예제 #4
0
 [Test] public void ReasonField()
 {
     o(F.ReasonField(null), null);
     o(F.ReasonField(""), null);
     o(F.ReasonField("Foo"), "Foo");
 }