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

Logging system rework #59

Merged
merged 5 commits into from
Mar 25, 2024
Merged

Logging system rework #59

merged 5 commits into from
Mar 25, 2024

Conversation

MRiganSUSX
Copy link
Contributor

@MRiganSUSX MRiganSUSX commented Mar 20, 2024

Please see details in DUNE-DAQ/trigger#285

@bieryAtFnal bieryAtFnal added the miscellaneous deliverable A change that is/will be part of a release but is not substantial enough to be a daq-deliverable label Mar 20, 2024
Copy link
Contributor

@ArturSztuc ArturSztuc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks good to me, although I find the trigger logging level names strange

Comment on lines +20 to +27
TLVL_VERY_IMPORTANT = 1,
TLVL_IMPORTANT = 2,
TLVL_GENERAL = 3,
TLVL_DEBUG_INFO = 4,
TLVL_DEBUG_LOW = 5,
TLVL_DEBUG_MEDIUM = 10,
TLVL_DEBUG_HIGH = 15,
TLVL_DEBUG_ALL = 20
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMPORTANT and VERY_IMPORTANT is strange naming (I guess GENERAL and DEBUG_INFO are too). Is the naming similar across the rest of the DAQ? The usual naming for different logging verbosity in the industry is:

  • TRACE for everything, so TLVL_DEBUG_ALL
  • DEBUG for the debugging messages (here it makes sense to have low, medium, high)
  • INFO would be your VERY_IMPORTANT, IMPORTANT and/or DEBUG_INFO,
  • WARN for warnings (we have different system for that),
  • ERROR for errors (we have different system for that),
  • FATAL for fatal errors that should crash (we have different system for that).

What are the namings in the rest of the DAQ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This naming is completely custom. As far as I know, there is no consistency across dunedaq. There are some repos that have a version of this, example in-file enum here and separare logging header here. Other places simply use integers example here, and these do go to high values (example here).

I just made that list according to what made sense to me, and wanted it to (a) be granural at the lower levels and (b) roughly cover the available space for levels. Open to changes. As you mentioned, we are not using standards from the industry (or at least not closely).

@@ -34,7 +40,7 @@ TriggerCandidateMakerMichelElectron::operator()(const TriggerActivity& activity,

// add_window_to_record(m_current_window);
// dump_window_record();
// TLOG(1) << "Constructing trivial TC.";
TLOG_DEBUG(TLVL_DEBUG_LOW) << "[TCM:ME] Constructing trivial TC.";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
TLOG_DEBUG(TLVL_DEBUG_LOW) << "[TCM:ME] Constructing trivial TC.";
TLOG_DEBUG(TLVL_DEBUG_LOW) << "[TCM:ME] Constructing a TC.";

I know this is not your doing, but might as well correct this... why "Constructing trivial TC"? Why "trivial"? Are there non-trivial TCs? I think just "Constructing a TC" would be fine here, and less confusing...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have not been generally modifying the messages (outside of few examples in MLT where I added more information). I agree with your change.

@@ -34,8 +40,8 @@ TriggerCandidateMakerPlaneCoincidence::operator()(const TriggerActivity& activit

// add_window_to_record(m_current_window);
// dump_window_record();
TLOG(1) << "Constructing trivial TC.";
TLOG(1) << "Activity count: " << m_activity_count;
TLOG_DEBUG(TLVL_DEBUG_LOW) << "[TCM:PC] Constructing trivial TC.";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
TLOG_DEBUG(TLVL_DEBUG_LOW) << "[TCM:PC] Constructing trivial TC.";
TLOG_DEBUG(TLVL_DEBUG_LOW) << "[TCM:PC] Constructing a TC.";

Ditto w.g. "trivial"

@MRiganSUSX
Copy link
Contributor Author

Thanks for the review. I have removed the 'trivial' messages in comment above.

@MRiganSUSX MRiganSUSX merged commit 47a7494 into production/v4 Mar 25, 2024
@MRiganSUSX MRiganSUSX deleted the mrigan/logging branch March 25, 2024 18:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
miscellaneous deliverable A change that is/will be part of a release but is not substantial enough to be a daq-deliverable
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants