Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(79)

Side by Side Diff: client/bin/site_logging.py

Issue 5519008: Create a cros directory under client, and start moving things into it. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/autotest.git@master
Patch Set: patch Created 10 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « client/bin/site_log_reader.py ('k') | client/bin/site_login.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. 1 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import logging, os, re 5 import logging, os, re
6 from autotest_lib.client.bin import site_log_reader, site_utils, test 6 from autotest_lib.client.bin import site_log_reader, site_utils, test
7 from autotest_lib.client.bin.chromeos_constants import CLEANUP_LOGS_PAUSED_FILE
8 from autotest_lib.client.common_lib import error, utils 7 from autotest_lib.client.common_lib import error, utils
8 from autotest_lib.client.cros.constants import CLEANUP_LOGS_PAUSED_FILE
9 9
10 class LogRotationPauser(object): 10 class LogRotationPauser(object):
11 """ 11 """
12 Class to control when logs are rotated from either server or client. 12 Class to control when logs are rotated from either server or client.
13 13
14 Assumes all setting of CLEANUP_LOGS_PAUSED_FILE is done by this class 14 Assumes all setting of CLEANUP_LOGS_PAUSED_FILE is done by this class
15 and that all calls to begin and end are properly 15 and that all calls to begin and end are properly
16 nested. For instance, [ a.begin(), b.begin(), b.end(), a.end() ] is 16 nested. For instance, [ a.begin(), b.begin(), b.end(), a.end() ] is
17 supported, but [ a.begin(), b.begin(), a.end(), b.end() ] is not. 17 supported, but [ a.begin(), b.begin(), a.end(), b.end() ] is not.
18 We do support redundant calls to the same class, such as 18 We do support redundant calls to the same class, such as
(...skipping 27 matching lines...) Expand all
46 self._begun = True 46 self._begun = True
47 47
48 48
49 def end(self): 49 def end(self):
50 assert self._begun 50 assert self._begun
51 if not self._is_nested: 51 if not self._is_nested:
52 self._run('rm -f ' + CLEANUP_LOGS_PAUSED_FILE) 52 self._run('rm -f ' + CLEANUP_LOGS_PAUSED_FILE)
53 else: 53 else:
54 logging.info('Leaving existing %s file' % CLEANUP_LOGS_PAUSED_FILE) 54 logging.info('Leaving existing %s file' % CLEANUP_LOGS_PAUSED_FILE)
55 self._begun = False 55 self._begun = False
OLDNEW
« no previous file with comments | « client/bin/site_log_reader.py ('k') | client/bin/site_login.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698