Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding a second logging target doesn't register #5

Open
johncblandii opened this issue Apr 21, 2010 · 0 comments
Open

Adding a second logging target doesn't register #5

johncblandii opened this issue Apr 21, 2010 · 0 comments

Comments

@johncblandii
Copy link

Steps:

  1. Initialize Swiz with TraceTarget as the only logging target
  2. Elsewhere in my app, after some initialization/stage updates, I add a TextAreaTarget [custom] through a loggingTargets.push(...).

Results:

  1. TraceTarget is only target to get the traces

Fix:
Instead of using push(), reassign the loggingTargets to a new array.

swiz.loggingTargets = [newTargetHere];

This has a downside of keeping the old target as well as the new one though. For this instance, I don't care but I could see where I might want to get rid of an old target but that doesn't seem to be happening.

Expected Results:
When I reset loggingTargets to a new array, I expect all old loggingTargets to be removed.

Notes:
I am aware of SwizLogger.addLoggingTarget(...). This is more about removing targets, which doesn't seem possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant