set log level built in keyword

1,274 views
Skip to first unread message

Jay

unread,
Jul 19, 2011, 4:35:20 PM7/19/11
to robotframework-users
My log.html file is too large. I found where the log is being filled
up and I put a Set Log Level before the lines causing the log to
bloat. I tried using warn fail and even trace, trying to find the
correct one. Is there an off? :) Nothing I used helped. The log.html
is over 100 MB at the lowest. 150 MB at the largest. Any pointers
would be helpful.

Pekka Klärck

unread,
Jul 20, 2011, 1:28:13 AM7/20/11
to jayd...@ieee.org, robotframework-users
2011/7/19 Jay <jayd...@ieee.org>:

Trace is the lowest level and causes everything (incl. certain
messages by the framework) to be logged. Warn level should have worked
for you (unless you log log of stuff with that level) but there's also
level 'none' [1]. For more information see the User Guide [2].

[1] http://robotframework.googlecode.com/hg/doc/libraries/BuiltIn.html?r=2.5.7#Set%20Log%20Level
[2] file:///home/peke/Devel/robotframework/doc/userguide/RobotFrameworkUserGuide.html#log-levels

Cheers,
.peke
--
Agile Tester/Developer/Consultant :: http://eliga.fi
Lead Developer of Robot Framework :: http://robotframework.org

Jay

unread,
Jul 20, 2011, 9:23:08 AM7/20/11
to robotframework-users
This is the way I used the set log level and it did nothing. Logs are
still over 100 MB.

\ Set Log Level NONE \ \
\ \
\ :FOR ${index} IN RANGE ${nmin}
${nmax} 1
\ \ ${tem} = Evaluate ${index}*${step}
\ \
\ \ Test voltage ${tem}\
\ \ \

If I do this, the logs go down to 2 MB.


\ Set Log Level NONE \ \
\ \
#\ :FOR ${index} IN RANGE $
{nmin} ${nmax} 1
#\ \ ${tem} = Evaluate ${index}*$
{step} \ \
#\ \ Test voltage ${tem}\
\ \ \

So I am quite sure the :FOR loop is the culprit. I also think that
putting the set log level just before calling the :FOR loop should
have the same affect but it does not. I must be using it incorrectly?
BTW, I am using Python 2.7. and 2.5.7 RF.

So what am I doing incorrect?

On Jul 19, 11:28 pm, Pekka Klärck <p...@iki.fi> wrote:
> 2011/7/19 Jay <jaydh...@ieee.org>:
>
> > My log.html file is too large. I found where the log is being filled
> > up and I put a Set Log Level before the lines causing the log to
> > bloat. I tried using warn fail and even trace, trying to find the
> > correct one. Is there an off? :) Nothing I used helped. The log.html
> > is over 100 MB at the lowest. 150 MB at the largest. Any pointers
> > would be helpful.
>
> Trace is the lowest level and causes everything (incl. certain
> messages by the framework) to be logged. Warn level should have worked
> for you (unless you log log of stuff with that level) but there's also
> level 'none' [1]. For more information see the User Guide [2].
>
> [1]http://robotframework.googlecode.com/hg/doc/libraries/BuiltIn.html?r=...

Jay

unread,
Jul 20, 2011, 9:32:08 AM7/20/11
to robotframework-users
I should have mentioned I found the builtin lib information before you
pointed it out. I am finally figuring out the documentation. I am
actually beginning to like the hyper links. :) Looking at the builtin
lib pointed out to me that NONE was a choice. The user document did
not show this to me. Just the fail warn ... So I really thought I had
it figured out.

On Jul 19, 11:28 pm, Pekka Klärck <p...@iki.fi> wrote:
> 2011/7/19 Jay <jaydh...@ieee.org>:
>
> > My log.html file is too large. I found where the log is being filled
> > up and I put a Set Log Level before the lines causing the log to
> > bloat. I tried using warn fail and even trace, trying to find the
> > correct one. Is there an off? :) Nothing I used helped. The log.html
> > is over 100 MB at the lowest. 150 MB at the largest. Any pointers
> > would be helpful.
>
> Trace is the lowest level and causes everything (incl. certain
> messages by the framework) to be logged. Warn level should have worked
> for you (unless you log log of stuff with that level) but there's also
> level 'none' [1]. For more information see the User Guide [2].
>
> [1]http://robotframework.googlecode.com/hg/doc/libraries/BuiltIn.html?r=...

Jussi Malinen

unread,
Jul 20, 2011, 9:48:10 AM7/20/11
to jayd...@ieee.org, robotframework-users
The log level will only affect how the messages, arguments, exceptions
and return values are written to log. If your for loop is really huge,
then it could be possible that just simply the basic for structure in
html is so big that it takes 100 mb even without any messages.

How may iterations are you doing in your for loop?

The next version of Robot framework will diminish the size of log
considerably in cases like this. It does some pretty clever stuff to
remove duplication in test logs (and if this analysis is correct, then
in your case, there should be a lot of duplication when you set the
log level to none). You could try out the new 2.6 release candidate
and see if that affects your log size.

Regards,
Jussi

> --
> You received this message because you are subscribed to the Google Groups "robotframework-users" group.
> To post to this group, send email to robotframe...@googlegroups.com.
> To unsubscribe from this group, send email to robotframework-u...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/robotframework-users?hl=en.
>
>

--
--
Jussi Malinen / Robot Framework
Reaktor, www.reaktor.fi

Jay

unread,
Jul 20, 2011, 10:21:15 AM7/20/11
to robotframework-users
Aha. I bet that is what the issue is. I thought NONE meant NONE. :)
There are over a million iterations, I believe.

Can I try the new version and not lose the current version> Or will I
have to remove the new and reinstall the old?

I will have to try it.
> > For more options, visit this group athttp://groups.google.com/group/robotframework-users?hl=en.

Pekka Klärck

unread,
Jul 20, 2011, 5:01:13 PM7/20/11
to jayd...@ieee.org, robotframework-users
2011/7/20 Jay <jayd...@ieee.org>:

> Aha. I bet that is what the issue is. I thought NONE meant NONE. :)
> There are over a million iterations, I believe.

You might want to consider moving the loop (or parts of it) from Robot
data to a test library. That way the loop would only be one keyword
and in the keyword you have full control on what you log.

> Can I try the new version and not lose the current version> Or will I
> have to remove the new and reinstall the old?

It should be OK to install 2.6 RC 1 over your previous RF release and
also to install e.g. RF 2.5.7 over the RC later. A problem with
installing over an existing installation is that old files are not
removed and they may in some rare cases cause problems. If things
don't work as expected, it's better to uninstall Robot altogether (see
User Guide for details) and install again.

Reply all
Reply to author
Forward
0 new messages