Skip to content

adb logcat collection skips over log messages while suspended #1000

@xr-gh

Description

@xr-gh

When you use the logcat collection feature and need to suspend the logcat collection, since the USB connection gets disabled, all logcat messages between the time the logcat collection was suspended until it gets resumed will be dropped, since we only look back one logcat message when starting the logcat collection: https://github.com/google/mobly/blob/master/mobly/controllers/android_device_lib/services/logcat.py#L250

    cmd = ' "%s" -s %s logcat -v threadtime -T 1 %s >> "%s" ' % (
        adb.ADB,
        self._ad.serial,
        self._config.logcat_params,
        self.adb_logcat_file_path,
    )

logcat also supports that a timestamp can be provided to the -T option, so that we can properly resume the logcat collection if we store the current system time as part of the suspend operation, and provide it to the command above when we resume the logcat collection.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions