summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Charles Yo <charlesyo@google.com> 2024-07-08 03:57:02 +0000
committer Charles Yo <charlesyo@google.com> 2024-07-08 03:57:02 +0000
commit164c8a8850f4129ef9537bb4d0b4f3f389c06fd0 (patch)
treec168bc836a5a8d0cf4cabdce071af84a1c9bb439
parent950c63f93924bdd322cf3bed6bb9e7c1e570f494 (diff)
Revert "Add logcat only ProtoLog impl"
Revert submission 28147757-no-processing-protolog Reason for revert: b/351458758 Reverted changes: /q/submissionid:28147757-no-processing-protolog Change-Id: I35a4985d3928c67e31d38f4e6892f6aa2f603c20
-rw-r--r--core/java/com/android/internal/protolog/LogcatOnlyProtoLogImpl.java80
1 files changed, 0 insertions, 80 deletions
diff --git a/core/java/com/android/internal/protolog/LogcatOnlyProtoLogImpl.java b/core/java/com/android/internal/protolog/LogcatOnlyProtoLogImpl.java
deleted file mode 100644
index 37d09c264c9b..000000000000
--- a/core/java/com/android/internal/protolog/LogcatOnlyProtoLogImpl.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Copyright (C) 2024 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.internal.protolog;
-
-import android.text.TextUtils;
-import android.util.Log;
-
-import com.android.internal.protolog.common.ILogger;
-import com.android.internal.protolog.common.IProtoLog;
-import com.android.internal.protolog.common.IProtoLogGroup;
-import com.android.internal.protolog.common.LogLevel;
-
-/**
- * Class only create and used to server temporarily for when there is source code pre-processing by
- * the ProtoLog tool, when the tracing to Perfetto flag is off, and the static REQUIRE_PROTOLOGTOOL
- * boolean is false. In which case we simply want to log protolog message to logcat. Note, that this
- * means that in such cases there is no real advantage of using protolog over logcat.
- *
- * @deprecated Should not be used. This is just a temporary class to support a legacy behavior.
- */
-@Deprecated
-public class LogcatOnlyProtoLogImpl implements IProtoLog {
- @Override
- public void log(LogLevel logLevel, IProtoLogGroup group, long messageHash, int paramsMask,
- Object[] args) {
- throw new RuntimeException("Not supported when using LogcatOnlyProtoLogImpl");
- }
-
- @Override
- public void log(LogLevel logLevel, IProtoLogGroup group, String messageString, Object[] args) {
- String formattedString = TextUtils.formatSimple(messageString, args);
- switch (logLevel) {
- case VERBOSE -> Log.v(group.getTag(), formattedString);
- case INFO -> Log.i(group.getTag(), formattedString);
- case DEBUG -> Log.d(group.getTag(), formattedString);
- case WARN -> Log.w(group.getTag(), formattedString);
- case ERROR -> Log.e(group.getTag(), formattedString);
- case WTF -> Log.wtf(group.getTag(), formattedString);
- }
- }
-
- @Override
- public boolean isProtoEnabled() {
- return false;
- }
-
- @Override
- public int startLoggingToLogcat(String[] groups, ILogger logger) {
- return 0;
- }
-
- @Override
- public int stopLoggingToLogcat(String[] groups, ILogger logger) {
- return 0;
- }
-
- @Override
- public boolean isEnabled(IProtoLogGroup group, LogLevel level) {
- return true;
- }
-
- @Override
- public void registerGroups(IProtoLogGroup... protoLogGroups) {
- // Does nothing
- }
-}