xref: /aosp_15_r20/external/cronet/base/android/proguard/remove_logging.flags (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
1# Copyright 2022 The Chromium Authors
2# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4
5# Remove Log.d(), Log.v(), and corresponding isLoggable() calls.
6# Log.DEBUG = 3, Log.VERBOSE = 2.
7# https://stackoverflow.com/questions/73876633/what-does-the-r8-maximumremovedandroidloglevel-option
8-maximumremovedandroidloglevel 3
9
10# Makes try-with-resources less inefficient. Saved 3.8kb when added.
11-assumenosideeffects class java.lang.Throwable {
12  void addSuppressed(...);
13}
14
15# Remove all logging calls via JDK Loggers. They are generally from
16# unused parts of third-party libraries.
17-assumenosideeffects class java.util.logging.Logger {
18    void finest(...);
19    void finer(...);
20    void fine(...);
21    void info(...);
22    void warning(...);
23    void severe(...);
24    void throwing(...);
25    void log(...);
26    void logp(...);
27    static java.util.logging.Logger getLogger(...) return _NONNULL_;
28    boolean isLoggable(...) return false;
29}
30
31# Remove accesses to Level.<thing> that go unused.
32-assumenosideeffects class java.util.logging.Level {
33  <fields>;
34  # Flogger uses Level objects, so do not set a return value for intValue().
35  int intValue();
36}
37
38# Remove fields of type Logger.
39-assumenosideeffects class * {
40  java.util.logging.Logger * return _NONNULL_;
41}
42