These modules are used internally. Libraries should just write to
stdout as explained at
http://robotframework.googlecode.com/svn/tags/robotframework-2.1/doc/userguide/RobotFrameworkUserGuide.html#logging-information
Cheers,
.peke
--
Agile Tester/Developer/Consultant :: http://eliga.fi
Lead Developer of Robot Framework :: http://robotframework.org
The main reason for this design is that you don't need to have any
dependency to Robot Framework modules. Additionally the same approach
works from Java code.
> So several months back I wrote my own Logger.py class, based on the
> logging methods in the Selenium library (_info(), _warn(), etc.).
> Some useful extensions to this library are _infoKW() and _debugKW()
> that do logging of entry to a keyword method with all its parameters
> and does special handling for non-ASCII parameters.
Do you need to log parameters always? In that case you might want to
try using '--loglevel trace'. The problem with both approaches is that
the log file can easily grow huge.
> I did this
> because I was building so many RF extension libraries (to date 16)
> that ALL needed to have the same capabilities. I simply derive each
> one from this logger class. I put it in a "Utils" folder, along with
> some other useful base classes. I use this in my AutoItLibrary that
> I'm trying to prepare for Open Source release, like this:
>
> import Utils.Logger
> import Utils.Counter
>
> class AutoItLibrary(Utils.Logger.Logger, Utils.Counter.Counter) :
This is fine. Personally I'd rather implement at least Logger as a
module so that there would be no need for inheritance. You could do
something like:
import logger
classe MyLibrary:
def some_keyword(self, arg):
logger.info('Got argument: %s' % arg)
> unfortunately this puts a dependency on Utils by AutoItLibrary.
> That's why I was wondering if there was any more standard way of doing
> this. Obviously the folks that developed SeleniumLibrary thought
> methods like this were useful and I completely agree and extended the
> idea.
>
> Do you think we could maybe have a new part of Robot Framework where
> classes to assist extension library developers could be placed so that
> we can all share them and rely on them being present, rather than each
> having to invent our own?
We've been thinking that it's so easy to implement needed loggers that
there's no need for such a generic module. I'm fine with adding it if
we got a patch with an implementation, some unit tests (this is pretty
simple so no need to many tests), and documentation to add to the user
guide so that others can also use it.