question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Question|Feature: Multi-Tag Writer

See original GitHub issue

The following scenario occurs:

  • Library 1: Logs to TAG “Lib1”
  • Library 2: Logs to TAG “Lib2”
  • Main program includes the libs (but cannot change them) and logs to TAG “Main”
  • All tags shall appear in the the same log (typically a file, but could be something else)

So the question is (or an idea if the feature does not exists yet) is:

Can a writer support multiple tags.

writer.tag = Lib1|Lib2|Main
writer.tag = Lib1,Lib2,Main

On writer creation the writer would then just need to be written so several positions on the matrix[TAG][LEVEL] like the levels already do. I am not sure whether this is already possible as the matrix supports this feature but it seems for each entry a new writer object is created and I could not find any other way on how to set the multiple tags on the writer. That approach would be a very small change to ConfigurationParser.

Possible other approaches to the problem are (but none is fully convincing)

  • SharedFileWriter (but this is an overkill with locking and seems to not work inside one thread in one program?)
  • Static writers like the Console writer (so a static File Writer with a static FileStream) do work
  • Having a “Forwarding” Writer does in principlly work (it forwards the log to another tag. But has a bit problems with the required log entries if they differ as you need to know about the required log entries before all writers exists).
  • Use an user defined writer (extend FileWriteR) which gets all TAGs and filter for the TAGS of interest.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
Git5000commented, Aug 20, 2020

I think it is a nice enhancement in function and configuration possibility for very little effort and risk. Your architecture of the tags and levels basically asks for such a feature 😃

After your hint this morning, I implemented for my use case the “catchall” function storing the necessary tags as a “user field”. The loggers work now as expected but it requires extending or copying all used writers. Which is no problem but not a very elegant solution. So I would revert that and use the multi-tag feature instead.

0reactions
github-actions[bot]commented, Oct 9, 2022

This closed issue has been locked automatically. However, please feel free to file a new issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Filtering questions by multiple tags - Meta Stack Exchange
But is there a way to view questions only for a certain set of tags > 1 tag? Mainly I'd like the union...
Read more >
Adding multiple tags in one feature file - Stack Overflow
I have one feature file with different scenarios. Is it a good idea to add multiple tags for each feature file? Feature: Login....
Read more >
Finding Questions in the Question Bank - Online Exam Software
There are a total of 8 questions whose category tag value is “writing”. There are a total of 5 questions whose level tag...
Read more >
Question Types - Qualtrics
Multiple Choice: Multiple choice questions form the basis of most research. They can be displayed as a traditional list of choices or as...
Read more >
Mark Up FAQs with Structured Data | Google Search Central
When you use FAQ structured data, you may help users discover information in a rich result. Learn about FAQ schema markup and see...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found