You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I seem to be misunderstanding how rules and ordering work
From this comment:
/// Rules compose to the maximal filter. I.e. if you have one rule for your
/// target that specifies all Message-s must be of Debug level, and then another
/// filter that specifies they have to be of Info level, then the rule of Info
/// will win, and all Debug-level messages will be filtered from the stream.
I'd expect this test to pass:
yield ftestCase "Rule Ordering" <| fun _ ->
let out = Fac.textWriter ()
let rules = [
Rule.empty |> Rule.setHieraString "Marten" |> Rule.setTarget "console" |> Rule.setLevel Info
Rule.empty |> Rule.setTarget "console" |> Rule.setLevel Verbose
]
let targets = [
Target.confTarget "console" (TextWriter.create <| TextWriter.TextWriterConf.create(out, out))
]
let logary = confLogary "tests" |> withRules rules |> withTargets targets |> validate |> runLogary |> run
let get = Registry.getLogger logary.registry >> run
let no1 = pnp "Marten" |> get
Expect.equal no1.level Info "Marten should be Info"
let no2 = pnp "Anything.Else" |> get
Expect.equal no2.level Verbose "Anything.Else should be Verbose"
But it's failing with
Marten should be Info. Actual value was Verbose but had expected it to be Info.
What am I doing wrong?
The text was updated successfully, but these errors were encountered:
i think, maybe there is a misleading here, the implementation now actually use the minimal strategy.
in pr #219 , we use strict strategy , and in there, there is no loglevel on logger, loglevel belongs to message and rule belongs to target. a logger just send msg to processing pipeline (can filter msg through its level) , after pipeline ,we know the msg will go to which targets, then the targets will filter them depend on its rules.
I seem to be misunderstanding how rules and ordering work
From this comment:
I'd expect this test to pass:
But it's failing with
What am I doing wrong?
The text was updated successfully, but these errors were encountered: