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

cylc set-verbosity does not set CYLC_DEBUG #5829

Closed
dpmatthews opened this issue Nov 20, 2023 · 3 comments · Fixed by #5854
Closed

cylc set-verbosity does not set CYLC_DEBUG #5829

dpmatthews opened this issue Nov 20, 2023 · 3 comments · Fixed by #5854
Assignees
Labels
bug Something is wrong :( small
Milestone

Comments

@dpmatthews
Copy link
Contributor

If I run a workflow using --debug then in the job scripts I get export CYLC_VERBOSE=true and export CYLC_DEBUG=true. However, if I run the workflow at normal verbosity and then set it to debug using cylc set-verbosity only CYLC_VERBOSE gets set to true in the job scripts (CYLC_DEBUG remains false).

--debug is defined as equivalent to -v -v in the cylc play help (i.e. it is just a verbosity level) so I would expect cylc set-verbosity DEBUG to result in export CYLC_DEBUG=true in the job scripts.

@dpmatthews dpmatthews added the bug Something is wrong :( label Nov 20, 2023
@dpmatthews dpmatthews added this to the cylc-8.x milestone Nov 20, 2023
@oliver-sanders
Copy link
Member

Context:

In debug mode the CYLC_DEBUG environment variable gets set to true which turns on some extra debugging.

The following two commands are identical:

$ cylc <command> -v -v
$ cylc <command> --deubg

The cylc set-verbosity command allows you to change the verbosity argument whilst the scheduler is running.

This is the code that gets run as a result of a cylc set-verbosity call:

def command_set_verbosity(lvl: Union[int, str]) -> None:
"""Set workflow verbosity."""
try:
lvl = int(lvl)
LOG.setLevel(lvl)
except (TypeError, ValueError) as exc:
raise CommandFailedError(exc)
cylc.flow.flags.verbosity = log_level_to_verbosity(lvl)

This is the code that turns the verbosity into the CYLC_DEBUG environment variable:

for key, value in verbosity_to_env(cylc.flow.flags.verbosity).items():
handle.write(f'\nexport {key}={value}')

@oliver-sanders
Copy link
Member

Minimal example to test:

[scheduling]
    [[graph]]
        R1 = test

[runtime]
    [[test]]
         script = echo "CYLC_DEBUG=$CYLC_DEBUG"

@oliver-sanders
Copy link
Member

Closed by #5854

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is wrong :( small
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants