-
Notifications
You must be signed in to change notification settings - Fork 192
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
So far, the verdi cli has been using a number of variants of click.secho in order to write information to the command line (e.g. echo_info(), echo_warning(), echo_critical(), ...). This automatically adds colored indicators for info/warning/... levels but offers no way to control which level of information is printed. For example, it is often useful to print information for debugging purposes, and so it would be useful to be able to specify a verbosity level when running verdi commands. Here, we use python's logging module to build a custom handler that outputs log messages via click. We also add a click VERBOSITY option that is applied automatically to all verdi commands. Its default verbosity level can be controlled via the new logging.verdi_loglevel configuration option. Note: The code added here is inspired by the click_log package (but needed to be modified in order to fit the needs of AiiDA). Co-authored-by: Sebastiaan Huber <mail@sphuber.net>
- Loading branch information
Showing
20 changed files
with
350 additions
and
138 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.