Beispiel #1
0
 def logcat_and_dmesg(dev='Null', logname=None, logon=False):
     """
     logcat  和  dmesg log
     """
     if logname is None:
         logname = '{0}/log/{1}-{2}'.format(Utils.get_sys_path(), dev,
                                            TimeUtils.strTimeName())
     result_dmesg, out_dmesg = Utils.adbshell(dev, "dmesg", logon)
     result_logcat, out_logcat = Utils.adbshell(dev, "logcat -d -v time",
                                                logon)
     if result_dmesg == 0:
         Utils.saveTxtFile('{0}-dmesg.log'.format(logname), data=out_dmesg)
     if result_logcat == 0:
         Utils.saveTxtFile('{0}-logcat.log'.format(logname),
                           data=out_logcat)
     return result_dmesg, out_dmesg, result_logcat, out_logcat
Beispiel #2
0
 def dmesg(dev='Null', logname=None, logon=False):
     """
     dmesg log
     """
     result, out = Utils.adbshell(dev, "dmesg", logon)
     if logname is None:
         logname = '{0}/log/{1}-{2}-dmesg.log'.format(
             Utils.get_sys_path(), dev, TimeUtils.strTimeName())
     if result == 0:
         v = Python_version()
         if v > 3.0:
             Utils.saveTxtFile(logname, data=out)
         else:
             Utils.saveTxtFile(logname, data=out)
     return result, out