Skip to content

Commit

Permalink
Show environment debug print only in verbose mode. (#776)
Browse files Browse the repository at this point in the history
* Show environment debug print only in verbose mode.

* Update change log.

* doc: Move changelog entry to Changed.

---------

Co-authored-by: Brandon Butler <[email protected]>
  • Loading branch information
joaander and b-butler authored Oct 30, 2023
1 parent ca207a6 commit ca38c29
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
4 changes: 4 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ Version 0.27
[0.27.0] -- 202x-xx-xx
----------------------

Changed
+++++++
- Show the "Using environment configuration:" message only in verbose output (#776).

Fixed
+++++

Expand Down
12 changes: 7 additions & 5 deletions flow/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -5126,11 +5126,6 @@ class MyProject(FlowProject):
)
self._environment.add_args(env_group)
parser_submit.set_defaults(func=self._main_submit)
print(
"Using environment configuration:",
self._environment.__name__,
file=sys.stderr,
)

parser_exec = subparsers.add_parser(
"exec",
Expand Down Expand Up @@ -5177,6 +5172,13 @@ class MyProject(FlowProject):
# Set verbosity level according to the `-v` argument.
logging.basicConfig(level=max(0, logging.WARNING - 10 * args.verbose))

if args.verbose >= 1:
print(
"Using environment configuration:",
self._environment.__name__,
file=sys.stderr,
)

try:
args.func(args)
except (TimeoutError, subprocess.TimeoutExpired) as error:
Expand Down

0 comments on commit ca38c29

Please sign in to comment.