1 // Copyright 2021 The Android Open Source Project
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 //      http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 package com.google.android.downloader;
16 
17 import com.google.errorprone.annotations.FormatMethod;
18 import com.google.errorprone.annotations.FormatString;
19 import javax.annotation.Nullable;
20 
21 /**
22  * Interface for a generic logging system, as used by the downloader. Allows the caller to configure
23  * the logging implementation as needed, and avoid extra dependencies in the downloader.
24  */
25 public interface DownloaderLogger {
26   @FormatMethod
logFine(@ormatString String message, Object... args)27   void logFine(@FormatString String message, Object... args);
28 
29   @FormatMethod
logInfo(@ormatString String message, Object... args)30   void logInfo(@FormatString String message, Object... args);
31 
32   @FormatMethod
logWarning(@ormatString String message, Object... args)33   void logWarning(@FormatString String message, Object... args);
34 
35   @FormatMethod
logWarning(@ullable Throwable cause, @FormatString String message, Object... args)36   void logWarning(@Nullable Throwable cause, @FormatString String message, Object... args);
37 
38   @FormatMethod
logError(@ormatString String message, Object... args)39   void logError(@FormatString String message, Object... args);
40 
41   @FormatMethod
logError(@ullable Throwable cause, @FormatString String message, Object... args)42   void logError(@Nullable Throwable cause, @FormatString String message, Object... args);
43 }
44