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); }
public bool Matches(object scope, string reason) => (this.scope?.ToString()).Equals(scope) && this.reason == TraceFormat.ReasonField(reason);
[Test] public void BadReason() { Assert.Throws <ArgEx>(() => F.ReasonField("(parens)")); }
[Test] public void ReasonField() { o(F.ReasonField(null), null); o(F.ReasonField(""), null); o(F.ReasonField("Foo"), "Foo"); }