3 new revisions:

Revision: 9390911488c4
Author:   Pekka Klärck
Date:     Mon May  9 04:51:28 2011
Log:      Support for writing messages to console to robot.api.logger...
http://code.google.com/p/robotframework/source/detail?r=9390911488c4

Revision: 3d5e83d110fa
Author:   Pekka Klärck
Date:     Mon May  9 04:52:02 2011
Log:      copyrights
http://code.google.com/p/robotframework/source/detail?r=3d5e83d110fa

Revision: dacdd1096a89
Author:   Pekka Klärck
Date:     Mon May  9 05:01:04 2011
Log:      Automated merge with https://robotframework.googlecode.com/hg/
http://code.google.com/p/robotframework/source/detail?r=dacdd1096a89

==============================================================================
Revision: 9390911488c4
Author:   Pekka Klärck
Date:     Mon May  9 04:51:28 2011
Log:      Support for writing messages to console to robot.api.logger

Update issue 339
There's now a separate `console` method for writing messages to
the console and `info` method also has optional `also_console`
argument for writing messages both to the log and to the console.
http://code.google.com/p/robotframework/source/detail?r=9390911488c4

Modified:
 /atest/robot/test_libraries/logging_api.txt
 /atest/testdata/test_libraries/LibUsingLoggingApi.py
 /atest/testdata/test_libraries/logging_api.txt
 /src/robot/api/logger.py

=======================================
--- /atest/robot/test_libraries/logging_api.txt Mon May  9 02:38:16 2011
+++ /atest/robot/test_libraries/logging_api.txt Mon May  9 04:51:28 2011
@@ -35,3 +35,10 @@
     Should contain X times  ${log}  <b>info</b>   1
     Should contain X times  ${log}  <b>debug</b>  1
     Should contain X times  ${log}  <b>warn</b>   2
+
+Write messages to console
+    ${tc} =  Check test case  ${TEST NAME}
+    Check stdout contains  To console only
+    Check stdout contains  To console in two parts
+    Check stdout contains  To log and console
+    Check log message  ${tc.kws[0].msgs[0]}  To log and console  INFO
=======================================
--- /atest/testdata/test_libraries/LibUsingLoggingApi.py Mon May 9 02:38:16 2011 +++ /atest/testdata/test_libraries/LibUsingLoggingApi.py Mon May 9 04:51:28 2011
@@ -17,3 +17,8 @@
     logger.info('<b>info</b>', html=True)
     logger.warn('<b>warn</b>', html=True)

+def write_messages_to_console():
+    logger.console('To console only')
+    logger.console('To console ', newline=False)
+    logger.console('in two parts')
+    logger.info('To log and console', also_console=True)
=======================================
--- /atest/testdata/test_libraries/logging_api.txt      Mon May  9 02:38:16 2011
+++ /atest/testdata/test_libraries/logging_api.txt      Mon May  9 04:51:28 2011
@@ -15,3 +15,6 @@
     Set log level  DEBUG
     Log HTML
     [Teardown]  Set log level  INFO
+
+Write messages to console
+    Write messages to console
=======================================
--- /src/robot/api/logger.py    Mon May  9 02:38:16 2011
+++ /src/robot/api/logger.py    Mon May  9 04:51:28 2011
@@ -1,3 +1,4 @@
+import sys
 from robot.output import LOGGER, Message


@@ -10,9 +11,15 @@
 def debug(msg, html=False):
     write(msg, 'DEBUG', html)

-def info(msg, html=False):
+def info(msg, html=False, also_console=False):
     write(msg, 'INFO', html)
+    if also_console:
+        console(msg)

 def warn(msg, html=False):
     write(msg, 'WARN', html)

+def console(msg, newline=True):
+    if newline:
+        msg += '\n'
+    sys.__stdout__.write(msg)

==============================================================================
Revision: 3d5e83d110fa
Author:   Pekka Klärck
Date:     Mon May  9 04:52:02 2011
Log:      copyrights
http://code.google.com/p/robotframework/source/detail?r=3d5e83d110fa

Modified:
 /src/robot/api/__init__.py
 /src/robot/api/logger.py

=======================================
--- /src/robot/api/__init__.py  Mon May  9 02:38:16 2011
+++ /src/robot/api/__init__.py  Mon May  9 04:52:02 2011
@@ -0,0 +1,13 @@
+#  Copyright 2008-2011 Nokia Siemens Networks Oyj
+#
+#  Licensed under the Apache License, Version 2.0 (the "License");
+#  you may not use this file except in compliance with the License.
+#  You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing, software
+#  distributed under the License is distributed on an "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#  See the License for the specific language governing permissions and
+#  limitations under the License.
=======================================
--- /src/robot/api/logger.py    Mon May  9 04:51:28 2011
+++ /src/robot/api/logger.py    Mon May  9 04:52:02 2011
@@ -1,4 +1,19 @@
+#  Copyright 2008-2011 Nokia Siemens Networks Oyj
+#
+#  Licensed under the Apache License, Version 2.0 (the "License");
+#  you may not use this file except in compliance with the License.
+#  You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing, software
+#  distributed under the License is distributed on an "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#  See the License for the specific language governing permissions and
+#  limitations under the License.
+
 import sys
+
 from robot.output import LOGGER, Message



==============================================================================
Revision: dacdd1096a89
Author:   Pekka Klärck
Date:     Mon May  9 05:01:04 2011
Log:      Automated merge with https://robotframework.googlecode.com/hg/
http://code.google.com/p/robotframework/source/detail?r=dacdd1096a89


Reply via email to