示例#1
0
 def test_empty_package_will_still_work(self):
     profile = Profile(name='package_filt')
     self.assertTrue(
         profile.include({
             'message':
             'Start proc com.example.test for activity tw.com.xxxx.android.yyyy/.333Activity: pid=123456 uid=10105 gids={3003}'
         }))
示例#2
0
 def test_package_name_filter(self):
     profile = Profile(name='package_filt', packages=['com.example.test'])
     self.assertFalse(
         profile.include({
             'message':
             'Start proc com.example.test for activity tw.com.xxxx.android.yyyy/.333Activity: pid=123456 uid=10105 gids={3003}'
         }))
     self.assertTrue(
         profile.include({
             'pid': '123456',
             'message': 'foo bar'
         }))
示例#3
0
    def __init__(self, args=None):
        self.parse_args(args)
        self.width = self.get_term_width()
        self.config = LogcatColorConfig(self.options)

        self.profile = None
        if len(self.args) >= 1:
            self.profile = Profile.get_profile(self.args[0])
            if self.profile:
                self.args = self.args[1:]

        if not self.profile:
            self.logcat_args.extend(self.args)

        self.format = None
        if self.options.format:
            self.format = self.options.format
        elif self.profile and self.profile.format:
            self.format = self.profile.format

        self.layout = self.format
        if self.options.plain:
            self.layout = "raw"
示例#4
0
 def test_empty_package_will_still_work(self):
     profile = Profile(name = 'package_filt')
     self.assertTrue(profile.include({'message' : 'Start proc com.example.test for activity tw.com.xxxx.android.yyyy/.333Activity: pid=123456 uid=10105 gids={3003}'}))
示例#5
0
 def test_package_name_filter(self):
     profile = Profile(name = 'package_filt', packages = ['com.example.test'])
     self.assertFalse(profile.include({'message' : 'Start proc com.example.test for activity tw.com.xxxx.android.yyyy/.333Activity: pid=123456 uid=10105 gids={3003}'}))
     self.assertTrue(profile.include({'pid' : '123456', 'message' : 'foo bar'}))