1 /* 2 * Copyright (C) 2019 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 package android.net.ipsec.ike; 17 18 import com.android.internal.annotations.VisibleForTesting; 19 import com.android.internal.net.utils.Log; 20 21 /** 22 * This class provides global logging methods. 23 * 24 * @hide 25 */ 26 public final class IkeManager { 27 private static final String IKE_TAG = "IKE"; 28 private static final boolean LOG_SENSITIVE = false; 29 30 private static Log sIkeLog = new Log(IKE_TAG, LOG_SENSITIVE); 31 32 /** 33 * Returns IKE logger. 34 * 35 * @hide 36 */ getIkeLog()37 public static Log getIkeLog() { 38 return sIkeLog; 39 } 40 41 /** 42 * Injects IKE logger for testing. 43 * 44 * @hide 45 */ 46 @VisibleForTesting setIkeLog(Log log)47 public static void setIkeLog(Log log) { 48 sIkeLog = log; 49 } 50 51 /** 52 * Resets IKE logger. 53 * 54 * @hide 55 */ 56 @VisibleForTesting resetIkeLog()57 public static void resetIkeLog() { 58 sIkeLog = new Log(IKE_TAG, LOG_SENSITIVE); 59 } 60 } 61