Warnings and errors on top of the log file actually go through the
syslog [1] which automatically writes messages with WARN and ERROR
level there. BuiltIn keyword Syslog can be used to write there from
the test data and in your own Python library you can use
BuiltIn().syslog method.
It's currently not possible to write to syslog from Java libraries (or
from libraries that otherwise cannot use framework's internal modules)
which is a quite big limitation. I have two ideas how to solve the
problem:
1) Add new syntax "log level" that can be used when writing to stdout.
Perhaps something like "print '*SYSLOG-WARN* My message'".
2) Automatically write log messages with level WARN to syslog.
Currently WARN level is a bit useless since you don't see those
messages unless you open the keyword that wrote it and this change
would make them more useful. We could also add new ERROR level that
would also be written to syslog automatically.
Any comments related to this? Both ideas are doable for 2.1.
Cheers,
.peke
[1] http://robotframework.googlecode.com/svn/trunk/doc/userguide/RobotFrameworkUserGuide.html#system-log
Thanks,
Martin
All this information already goes to syslog:
http://robotframework.googlecode.com/svn/trunk/doc/userguide/RobotFrameworkUserGuide.html#system-log
Cheers,
.peke
All this information already goes to syslog:
The most common problem with the log file is that it is getting too
big. Adding more information there, especially when that information
is already available in another log, doesn't feel like that good idea
in this situation. Just adding the command line parameters wouldn't
increase the size that much, but that might not be enough and we
needed to add more information. Finally, there currently isn't any
clear place where to add all this information.
Please submit the enhancement idea to the tracker anyway. If it gets
popular (counted from votes/stars) and it's possible to agree on what
information to show, implementing this in the future is possible.
In the meantime, you can instruct your users to always execute tests
with syslog enabled and iinclude also the syslog file when they report
problems. Perhaps you can instruct that ROBOT_SYSLOG_FILE environment
variable is set as part of the installation so that people don't need
to think about it afterwards.
Cheers,
.peke
This is now issue 200:
http://code.google.com/p/robotframework/issues/detail?id=200
Cheers,
.peke
I somehow only noticed "record pybot command" and not that you also
wanted to get all the console output to the log file too. My earlier
comments were only related to logging the command that started the
execution (and possible some more information about the environment).
As I wrote, adding something like that is possible but it's not likely
to happen in the near future.
On the other hand, writing the terminal output to the log file won't
happen, simply because absolutely everything in the terminal is
already available in the log. This includes all the warnings and
errors written before and during the execution. If you notice
something that is available on the terminal but on the log, please
report it separately since that would be a pretty severe bug.
Cheers,
.peke