Title: [136036] trunk/Tools
- Revision
- 136036
- Author
- zandober...@gmail.com
- Date
- 2012-11-28 11:54:25 -0800 (Wed, 28 Nov 2012)
Log Message
Remove deprecated logging usage from QueueEngine
https://bugs.webkit.org/show_bug.cgi?id=103532
Reviewed by Dirk Pranke.
Replace usage of deprecated logging in webkitpy.tool.bot.queueengine with
logging through the Logger object. The unit test is modified to reflect
these changes.
After these changes the deprecated logging (i.e. logging to stderr) is not
used anymore through webkitpy and can be removed.
* Scripts/webkitpy/tool/bot/queueengine.py:
(QueueEngine.exit_after_handled_error):
(QueueEngine.run):
(QueueEngine._stopping):
(QueueEngine._sleep):
* Scripts/webkitpy/tool/bot/queueengine_unittest.py:
(QueueEngineTest._run_engine):
Modified Paths
Diff
Modified: trunk/Tools/ChangeLog (136035 => 136036)
--- trunk/Tools/ChangeLog 2012-11-28 19:47:26 UTC (rev 136035)
+++ trunk/Tools/ChangeLog 2012-11-28 19:54:25 UTC (rev 136036)
@@ -1,3 +1,25 @@
+2012-11-28 Zan Dobersek <zandober...@gmail.com>
+
+ Remove deprecated logging usage from QueueEngine
+ https://bugs.webkit.org/show_bug.cgi?id=103532
+
+ Reviewed by Dirk Pranke.
+
+ Replace usage of deprecated logging in webkitpy.tool.bot.queueengine with
+ logging through the Logger object. The unit test is modified to reflect
+ these changes.
+
+ After these changes the deprecated logging (i.e. logging to stderr) is not
+ used anymore through webkitpy and can be removed.
+
+ * Scripts/webkitpy/tool/bot/queueengine.py:
+ (QueueEngine.exit_after_handled_error):
+ (QueueEngine.run):
+ (QueueEngine._stopping):
+ (QueueEngine._sleep):
+ * Scripts/webkitpy/tool/bot/queueengine_unittest.py:
+ (QueueEngineTest._run_engine):
+
2012-11-28 Nate Chapin <jap...@chromium.org>
Move empty loading to DocumentLoader, simplify FrameLoader::init()
Modified: trunk/Tools/Scripts/webkitpy/tool/bot/queueengine.py (136035 => 136036)
--- trunk/Tools/Scripts/webkitpy/tool/bot/queueengine.py 2012-11-28 19:47:26 UTC (rev 136035)
+++ trunk/Tools/Scripts/webkitpy/tool/bot/queueengine.py 2012-11-28 19:54:25 UTC (rev 136036)
@@ -27,15 +27,18 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+import logging
import sys
import traceback
from datetime import datetime, timedelta
from webkitpy.common.system.executive import ScriptError
-from webkitpy.common.system.deprecated_logging import log, OutputTee
+from webkitpy.common.system.deprecated_logging import OutputTee
+_log = logging.getLogger(__name__)
+
# FIXME: This will be caught by "except Exception:" blocks, we should consider
# making this inherit from SystemExit instead (or BaseException, except that's not recommended).
class TerminateQueue(Exception):
@@ -80,7 +83,7 @@
# Child processes exit with a special code to the parent queue process can detect the error was handled.
@classmethod
def exit_after_handled_error(cls, error):
- log(error)
+ _log.error(error)
sys.exit(cls.handled_error_code)
def run(self):
@@ -100,7 +103,7 @@
self._open_work_log(work_item)
try:
if not self._delegate.process_work_item(work_item):
- log("Unable to process work item.")
+ _log.warning("Unable to process work item.")
continue
except ScriptError, e:
# Use a special exit code to indicate that the error was already
@@ -123,7 +126,7 @@
return 0
def _stopping(self, message):
- log("\n%s" % message)
+ _log.info("\n%s" % message)
self._delegate.stop_work_queue(message)
# Be careful to shut down our OutputTee or the unit tests will be unhappy.
self._ensure_work_log_closed()
@@ -154,6 +157,6 @@
return "%s Sleeping until %s (%s)." % (message, wake_time.strftime(self.log_date_format), self.sleep_duration_text)
def _sleep(self, message):
- log(self._sleep_message(message))
+ _log.info(self._sleep_message(message))
self._wakeup_event.wait(self.seconds_to_sleep)
self._wakeup_event.clear()
Modified: trunk/Tools/Scripts/webkitpy/tool/bot/queueengine_unittest.py (136035 => 136036)
--- trunk/Tools/Scripts/webkitpy/tool/bot/queueengine_unittest.py 2012-11-28 19:47:26 UTC (rev 136035)
+++ trunk/Tools/Scripts/webkitpy/tool/bot/queueengine_unittest.py 2012-11-28 19:54:25 UTC (rev 136036)
@@ -145,8 +145,8 @@
engine = QueueEngine("test-queue", delegate, threading.Event())
if not termination_message:
termination_message = "Delegate terminated queue."
- expected_stderr = "\n%s\n" % termination_message
- OutputCapture().assert_outputs(self, engine.run, expected_stderr=expected_stderr)
+ expected_logs = "\n%s\n" % termination_message
+ OutputCapture().assert_outputs(self, engine.run, expected_logs=expected_logs)
def _test_terminating_queue(self, exception, termination_message):
work_item_index = LoggingDelegate.expected_callbacks.index('process_work_item')
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes