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

BuiltIn: New Reset Log Level keyword for resetting the log level to the original value #4930

Closed
richardstone opened this issue Nov 6, 2023 · 2 comments

Comments

@richardstone
Copy link

Opened this request after the discussion under #4919

I'd like to request adding a new keyword Reset Log Level that would always reset the log level to the one set with --loglevel argument to robot, or to INFO if not set.

It would ease the work as now if I want to revert to the previous log level after a Set Log Level keyword, I need to store the previous keyword in an extra variable.

@pekkaklarck
Copy link
Member

Yeah, avoiding storing the previous level to a variable would be convenient in general and especially if the level is set and then reset in different keywords.

The only design question I see is should this keyword reset to the previous level or to the original level set using the --loglevel option. We could also support both with an optional argument. Or, possibly better, we could enhance the current Set Log Level keyword so that it accepts pseudo log levels PREVIOUS and ORIGINAL.

@pekkaklarck pekkaklarck added this to the v7.1 milestone Dec 19, 2023
@pekkaklarck pekkaklarck self-assigned this Dec 19, 2023
@pekkaklarck
Copy link
Member

Being able to reset the level without storing the old value returned by Set Log Level is convenient because it allows setting the level in a setup and then resetting it in a teardown. I raised the priority accordingly and, because this is trivial to implement, added to RF 7.0 scope.

I decided to implement this so that Reset Log Level always resets the original level. If there are needs for setting the previous level, we can consider making the behavior configurable later.

@pekkaklarck pekkaklarck changed the title Feature request: new keyword "Reset Log Level" BuiltIn: New Reset Log Level for resetting the log level to the original value Dec 19, 2023
@pekkaklarck pekkaklarck changed the title BuiltIn: New Reset Log Level for resetting the log level to the original value BuiltIn: New Reset Log Level keyword for resetting the log level to the original value Dec 19, 2023
@pekkaklarck pekkaklarck modified the milestones: v7.1, v7.0 Dec 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants