2 new revisions:
Revision: 8a55d9ee283b
Branch: default
Author: Mikko Korpela <[email protected]>
Date: Thu Nov 14 13:18:02 2013 UTC
Log: debugfile: Add timestamp and log level
http://code.google.com/p/robotframework/source/detail?r=8a55d9ee283b
Revision: d0759a50178d
Branch: default
Author: Mikko Korpela <[email protected]>
Date: Thu Nov 14 13:18:23 2013 UTC
Log: merge
http://code.google.com/p/robotframework/source/detail?r=d0759a50178d
==============================================================================
Revision: 8a55d9ee283b
Branch: default
Author: Mikko Korpela <[email protected]>
Date: Thu Nov 14 13:18:02 2013 UTC
Log: debugfile: Add timestamp and log level
http://code.google.com/p/robotframework/source/detail?r=8a55d9ee283b
Modified:
/atest/robot/cli/runner/debugfile.txt
/src/robot/output/debugfile.py
=======================================
--- /atest/robot/cli/runner/debugfile.txt Mon Jun 3 14:47:43 2013 UTC
+++ /atest/robot/cli/runner/debugfile.txt Thu Nov 14 13:18:02 2013 UTC
@@ -3,6 +3,9 @@
Default Tags regression pybot jybot
Resource cli_resource.txt
+*** Variables ***
+${TIMESTAMP AND LOGLEVEL} ???????? ??:??:??.??? - * -
+
*** Test Cases ***
@@ -12,8 +15,8 @@
${content} = Log File ${CLI OUTDIR}${/}DeBug.TXT
Should Contain ${content} + START SUITE: Normal
Should Contain ${content} +- START TEST: First One
- Should Contain ${content} +-- START KW: BuiltIn.Log [ Test 1 ]\n
Test 1\n +-- END KW: BuiltIn.Log
- Should Contain ${content} +-- START KW: BuiltIn.Log [ Logging with
debug level | DEBUG ]\n Logging with debug level\n +-- END KW: BuiltIn.Log
+ Should Match ${content} *+-- START KW: BuiltIn.Log [ Test 1
]\n${TIMESTAMP AND LOGLEVEL} Test 1\n${TIMESTAMP AND LOGLEVEL} +-- END KW:
BuiltIn.Log*
+ Should Match ${content} *+-- START KW: BuiltIn.Log [ Logging with
debug level | DEBUG ]\n${TIMESTAMP AND LOGLEVEL} Logging with debug
level\n${TIMESTAMP AND LOGLEVEL} +-- END KW: BuiltIn.Log*
Should Contain ${content} + END SUITE: Normal
Check Syslog Contains DebugFile: DeBug.TXT
${path} = Set Variable [:.\\w /\\\\~+-]*DeBug\\.TXT
@@ -24,8 +27,8 @@
[Documentation] --loglevel option should not affect what's written to
debugfile
Run Tests Without Processing Output --outputdir ${CLI OUTDIR} -b
debug.txt -o o.xml --loglevel WARN ${TESTFILE}
${content} = Log File ${CLI OUTDIR}${/}debug.txt
- Should Contain ${content} +-- START KW: BuiltIn.Log [ Test 1 ]\n
Test 1\n +-- END KW: BuiltIn.Log
- Should Contain ${content} +-- START KW: BuiltIn.Log [ Logging with
debug level | DEBUG ]\n Logging with debug level\n +-- END KW: BuiltIn.Log
+ Should Match ${content} *+-- START KW: BuiltIn.Log [ Test 1
]\n${TIMESTAMP AND LOGLEVEL} Test 1\n${TIMESTAMP AND LOGLEVEL} +-- END KW:
BuiltIn.Log*
+ Should Match ${content} *+-- START KW: BuiltIn.Log [ Logging with
debug level | DEBUG ]\n${TIMESTAMP AND LOGLEVEL} Logging with debug
level\n${TIMESTAMP AND LOGLEVEL} +-- END KW: BuiltIn.Log*
No Debugfile
Run Tests Without Processing Output --outputdir ${CLI OUTDIR}
--debugfile NoNe -o o.xml ${TESTFILE}
=======================================
--- /src/robot/output/debugfile.py Thu Jun 6 14:00:44 2013 UTC
+++ /src/robot/output/debugfile.py Thu Nov 14 13:18:02 2013 UTC
@@ -78,7 +78,7 @@
def log_message(self, msg):
if self._is_logged(msg.level):
- self._write(msg.message)
+ self._write(msg.message, msg_level=msg.level)
def close(self):
if not self._outfile.closed:
@@ -101,8 +101,11 @@
def _separator(self, type_):
self._write(self._separators[type_] * 78, separator=True)
- def _write(self, text, separator=False):
- if not (separator and self._separator_written_last):
- self._outfile.write(text.encode('UTF-8').rstrip() + '\n')
- self._outfile.flush()
- self._separator_written_last = separator
+ def _write(self, text, separator=False, msg_level='INFO'):
+ if separator and self._separator_written_last:
+ return
+ if not separator:
+ text = '%s - %s - %s' % (utils.get_timestamp(), msg_level,
text)
+ self._outfile.write(text.encode('UTF-8').rstrip() + '\n')
+ self._outfile.flush()
+ self._separator_written_last = separator
==============================================================================
Revision: d0759a50178d
Branch: default
Author: Mikko Korpela <[email protected]>
Date: Thu Nov 14 13:18:23 2013 UTC
Log: merge
http://code.google.com/p/robotframework/source/detail?r=d0759a50178d
--
---
You received this message because you are subscribed to the Google Groups "robotframework-commit" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.