Add working example of environment based time zones#73
Open
emmuhamm wants to merge 12 commits into
Open
Conversation
Collaborator
Author
Collaborator
Author
|
How to view timezones In [40]: import pytz |
67b4c5c to
9861dac
Compare
emmuhamm
commented
Jun 4, 2026
| The docs are assembled from multiple sources at build time: | ||
|
|
||
| - `docs/` contains user-facing content | ||
| - `docs/` contains user-facing content. **Note that this is also used in the dunedaq readthedocs.** |
Collaborator
Author
There was a problem hiding this comment.
Noticed a bit of clarity I can stick in here while im updating the docs anyway
Collaborator
Author
|
@PawelPlesniak review pls :) When this is all good and merged, I'll let kurt know about this |
| `daqpytools` has the power for you to configure your current instance of the loggings! This allows each user to change the timezone and the color themes to suit them as the logs come out. | ||
|
|
||
| The way this is configured is by setting environment variables. By default, these are _unset_ in the terminal, which daqpytools will read and resolve to a default value. These default values can be found in `logging/log_format.ini`. | ||
|
|
Collaborator
There was a problem hiding this comment.
I would suggest having a line stating something along the lines of
If a non-default time zone/theme is preferred, it is recommended to set the env vars DUNEDAQ_TIMEZONE and DUNEDAQ_LOGGING_THEME in your ~/.bashrc
Also non-review note, reading the black theme in a black terminal is impossible XD
Collaborator
PawelPlesniak
left a comment
There was a problem hiding this comment.
Small comment, but other than that, nice work!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Description
Fix #70
Add better timezone handling. This is going to be optionally done by an environment variable, which overrides the log_format.ini settings.
Add better theme handling. This is also going to optionally done by an environment variable, which overrides the log_format.ini settings.
For full explanations, please see the docs in this PR, and also the testing notes
Testing notes
Tested on latest nightly (doesnt matter which)
Run
export DUNEDAQ_TIMEZONE="Europe/London"export DUNEDAQ_LOGGING_THEME="dark"and
daqpytools-logging-demonstrator -rSee how the colors and the timezones has changed. Play around with various timezones and themes.
When finish, run
export DUNEDAQ_TIMEZONE=""export DUNEDAQ_LOGGING_THEME=""And see how they revert back to their default behaviour
TODO:
Type of change
Testing checklist
dbt-build --unittest)pytest -s minimal_system_quick_test.py)dunedaq_integtest_bundle.sh)python -m pytest)pre-commit run --all-files)Comments here on the testing
Further checks
dbt-build --lint, and/or see https://dune-daq-sw.readthedocs.io/en/latest/packages/styleguide/)(Indicate issue here: # (issue))