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

DM-43040: Add command line options for setting log level and file #45

Merged
merged 1 commit into from Mar 1, 2024

Conversation

JeremyMcCormick
Copy link
Collaborator

@JeremyMcCormick JeremyMcCormick commented Feb 27, 2024

Two command line options are added for setting the Felis log level and, optionally, an output file for log messages.

To set these using command line options:

felis --loglevel INFO --logfile ./log.txt validate yml/*.yaml

And they may also be set using environment variables:

export FELIS_LOGLEVEL=INFO
export FELIS_LOGFILE=./log.txt

These settings apply to the root logger which will also affect the child loggers. Different settings for each module logger are probably not needed right now.

Copy link

codecov bot commented Feb 27, 2024

Codecov Report

Attention: Patch coverage is 71.42857% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 93.28%. Comparing base (832e8e1) to head (ebd4d21).

Files Patch % Lines
python/felis/cli.py 71.42% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #45      +/-   ##
==========================================
- Coverage   93.36%   93.28%   -0.08%     
==========================================
  Files          20       20              
  Lines        2109     2114       +5     
  Branches      425      428       +3     
==========================================
+ Hits         1969     1972       +3     
- Misses         81       82       +1     
- Partials       59       60       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

@gpdf gpdf left a comment

Choose a reason for hiding this comment

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

Looks good

@timj
Copy link
Member

timj commented Feb 27, 2024

Can you consider using option names that match what we use in butler?

@JeremyMcCormick
Copy link
Collaborator Author

Can you consider using option names that match what we use in butler?

Yes, I can change the CL options to log-level and log-file to match Butler.

Two command line options are added for setting the Felis log level and,
optionally, an output file for log messages. The log level is set using
the "log-level" option and the output file using "log-file." These
should match similar options in the lsst/daf_butler repo.
@JeremyMcCormick JeremyMcCormick merged commit cdce801 into main Mar 1, 2024
9 of 11 checks passed
@JeremyMcCormick JeremyMcCormick deleted the tickets/DM-43040 branch March 1, 2024 17:33
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

Successfully merging this pull request may close these issues.

None yet

3 participants