Closed GoogleCodeExporter closed 9 years ago
I think you misunderstood the setup process. (Which means we have to work on
the documentation). Maybe its easy to explain if I show what you want like this:
* debug -> trace
* info -> trace
* warn -> trace
* error -> trace,air
* fatal -> trace,air
Each of the level should be redirected to a target. You recognized that we just
have 1 logTarget per level. It is possible to mergeTargets (a class in our
list) which combines multiple targets to one.
var mergedTarget: MergedTarget = mergeTargets(trace,air);
Now: Lets say I apply just "trace" to all levels:
LOGGER_FACTORY.setup = new SimpleTargetSetup(trace);
then all our levels look like this:
* debug -> trace
* info -> trace
* warn -> trace
* error -> trace
* fatal -> trace
As you said correctly before: MergedSetup is executed after the first one.
Luckily: LevelTargetSetup overrides only the active levels, so:
var trace: TraceTarget = new TraceTarget;
var air: AirFileTarget = new AirFileTarget;
LOGGER_FACTORY.setup = mergeSetups(
new SimpleTargetSetup(trace),
new LevelTargetSetup(mergeTargets(trace,air), LogSetupLevel.ERROR);
);
Now, the second setup will override the ERROR and FATAL target to the merged
target.
* debug -> trace
* info -> trace
* warn -> trace
* error -> merged(trace,air)
* fatal -> merged(trace,air)
I hope this makes the setup process a little clearer. We plan to have a "log4j"
style setup in the next release which works in the semantics like log4j, like
in your example.
Original comment by martin.h...@gmail.com
on 22 Sep 2011 at 2:32
Thank you so much!
Original comment by matys8...@gmail.com
on 22 Sep 2011 at 7:26
Original issue reported on code.google.com by
matys8...@gmail.com
on 21 Sep 2011 at 10:08