How to clear the appium logcats

Hi All,

Currently my desire is to clear the logcats which returned by appium like below code

List logEntries = driver.manage().logs().get(“logcat”).getAll();

	for (LogEntry logEntry : logEntries) {
	    if (logEntry.getMessage().contains("testing_aws")) {

The above code will return “testing_aws” named logs, but i want to clear those logEntries after performed any action on my android app. I have tried executing “adb logcat -c” command by below code but it is not clearing the logs.

	String[] temp = { "/home/jagadeesh/android-sdk-linux/platform-tools/adb", "logcat", "-c" };

Do we have any method/way to clear those logs from appium itself instead of using adb commands…!! even though “adb logcat -c” is not clearing the data as i mentioned above code. can anyone help me out?