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

Side by Side Diff: client/bin/site_log_reader.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_cryptohome.py ('k') | client/bin/site_logging.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 os, re 5 import os, re
6 from autotest_lib.client.bin.chromeos_constants import CLEANUP_LOGS_PAUSED_FILE
7 from autotest_lib.client.common_lib import error, utils 6 from autotest_lib.client.common_lib import error, utils
7 from autotest_lib.client.cros.constants import CLEANUP_LOGS_PAUSED_FILE
8 8
9 class LogReader(object): 9 class LogReader(object):
10 """ 10 """
11 A class to read system log files. 11 A class to read system log files.
12 """ 12 """
13 13
14 def __init__(self, filename='/var/log/messages'): 14 def __init__(self, filename='/var/log/messages'):
15 self._start_line = 1 15 self._start_line = 1
16 self._filename = filename 16 self._filename = filename
17 if not os.path.exists(CLEANUP_LOGS_PAUSED_FILE): 17 if not os.path.exists(CLEANUP_LOGS_PAUSED_FILE):
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 """ 71 """
72 return utils.system_output('tail -n +%d %s' % 72 return utils.system_output('tail -n +%d %s' %
73 (self._start_line, self._filename)) 73 (self._start_line, self._filename))
74 74
75 def can_find(self, string): 75 def can_find(self, string):
76 """ Try to find string in the logs. 76 """ Try to find string in the logs.
77 77
78 @return boolean indicating if we found the string. 78 @return boolean indicating if we found the string.
79 """ 79 """
80 return string in self.get_logs() 80 return string in self.get_logs()
OLDNEW
« no previous file with comments | « client/bin/site_cryptohome.py ('k') | client/bin/site_logging.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698