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
Add new pseudo log level CONSOLE
that logs to console and to log file
#4536
Comments
Do you mean that if you'd log something with a level CONSOLE, it would be logged to the console? For example:
That sounds fine to me. The I guess it would make sense to log the message to the log file using INFO level as well. In practice CONSOLE would then be a new pseudo level like HTML that logs the message as INFO so that the message is rendered as HTML. We could consider making it possible to change the level of the message written to log with something like CONSOLE:WARN and HTML:DEBUG, but that would require its own issue. |
Yes, exactly. "level=CONSOLE", its provided information about intend where information will be printed. |
New options can be added to keywords if needed. What I like about adding CONSOLE pseudo log level is that it doesn't need them, all keywords that support customizing the log level benefit from it automatically. Supporting level with CONSOLE, and HTML, wouldn't be hard but should get its own issue. We could also support HTML:CONSOLE:DEBUG if needed. This would be a safe enhancement to do already in RF 6.1. It's also pretty easy so good candidate for someone wanting to contribute. |
CONSOLE
that logs to console and to log file
I do not really get it. Scenario: *** Task ***
Task
Log Hello level=CONSOLE #what should happen here???
Log World level=DEBUG #It is logged as DEBUG
Log Failure level=ERROR #It is logged as Error So would be But how would you prevent that logging? For me that sounds inconsistent and would be better to implement as library keyword in an own lib. |
I see it as level above INFO since print more then info itself.
Yes, but this change is mostly in mind of other keywords And for preventing that log its for me weird question, since when you set to log level to console you expect to log to console, the same as you would as The author decide expected behavior |
Yeah, this feature isn't useful at all with the Log keyword, it already has a separate |
I think that
Having a
This means that what you plan to implement is adding the |
For me any solution that allow to print to console list of dictionary is ok for me |
There was a comment above stating that it would be better to add optional Another benefit of this new pseudo level is that in simple libraries you can write to console using |
When using `print('*CONSOLE* Message')`, the space before `Message` was included into the message logged to the console. It's removed from the message written to the log file later, but needs to be removed separately here. This minor fix is related to #4536.
When using `print('*CONSOLE* Message')`, the space before `Message` was included into the message logged to the console. It's removed from the message written to the log file later, but needs to be removed separately here. This minor fix is related to #4536.
It would be useful to allow set log level to "Console" for keyword,
Currently To print list of dictionary you have to do it your self using Log To Console
Keywords in mind
The text was updated successfully, but these errors were encountered: