Changeset 136036 in webkit


Ignore:
Timestamp:
Nov 28, 2012, 11:54:25 AM (12 years ago)
Author:
zandobersek@gmail.com
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):

Location:
trunk/Tools
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r136031 r136036  
     12012-11-28  Zan Dobersek  <zandobersek@gmail.com>
     2
     3        Remove deprecated logging usage from QueueEngine
     4        https://bugs.webkit.org/show_bug.cgi?id=103532
     5
     6        Reviewed by Dirk Pranke.
     7
     8        Replace usage of deprecated logging in webkitpy.tool.bot.queueengine with
     9        logging through the Logger object. The unit test is modified to reflect
     10        these changes.
     11
     12        After these changes the deprecated logging (i.e. logging to stderr) is not
     13        used anymore through webkitpy and can be removed.
     14
     15        * Scripts/webkitpy/tool/bot/queueengine.py:
     16        (QueueEngine.exit_after_handled_error):
     17        (QueueEngine.run):
     18        (QueueEngine._stopping):
     19        (QueueEngine._sleep):
     20        * Scripts/webkitpy/tool/bot/queueengine_unittest.py:
     21        (QueueEngineTest._run_engine):
     22
    1232012-11-28  Nate Chapin  <japhet@chromium.org>
    224
  • trunk/Tools/Scripts/webkitpy/tool/bot/queueengine.py

    r108737 r136036  
    2828# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    2929
     30import logging
    3031import sys
    3132import traceback
     
    3435
    3536from webkitpy.common.system.executive import ScriptError
    36 from webkitpy.common.system.deprecated_logging import log, OutputTee
     37from webkitpy.common.system.deprecated_logging import OutputTee
     38
     39_log = logging.getLogger(__name__)
    3740
    3841
     
    8184    @classmethod
    8285    def exit_after_handled_error(cls, error):
    83         log(error)
     86        _log.error(error)
    8487        sys.exit(cls.handled_error_code)
    8588
     
    101104                try:
    102105                    if not self._delegate.process_work_item(work_item):
    103                         log("Unable to process work item.")
     106                        _log.warning("Unable to process work item.")
    104107                        continue
    105108                except ScriptError, e:
     
    124127
    125128    def _stopping(self, message):
    126         log("\n%s" % message)
     129        _log.info("\n%s" % message)
    127130        self._delegate.stop_work_queue(message)
    128131        # Be careful to shut down our OutputTee or the unit tests will be unhappy.
     
    155158
    156159    def _sleep(self, message):
    157         log(self._sleep_message(message))
     160        _log.info(self._sleep_message(message))
    158161        self._wakeup_event.wait(self.seconds_to_sleep)
    159162        self._wakeup_event.clear()
  • trunk/Tools/Scripts/webkitpy/tool/bot/queueengine_unittest.py

    r134636 r136036  
    146146        if not termination_message:
    147147            termination_message = "Delegate terminated queue."
    148         expected_stderr = "\n%s\n" % termination_message
    149         OutputCapture().assert_outputs(self, engine.run, expected_stderr=expected_stderr)
     148        expected_logs = "\n%s\n" % termination_message
     149        OutputCapture().assert_outputs(self, engine.run, expected_logs=expected_logs)
    150150
    151151    def _test_terminating_queue(self, exception, termination_message):
Note: See TracChangeset for help on using the changeset viewer.