1 /* 2 * Copyright (C) 2020 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 17 package com.android.systemui.statusbar.notification.row 18 19 import com.android.systemui.log.LogBuffer 20 import com.android.systemui.log.LogLevel.INFO 21 import com.android.systemui.log.LogLevel.WARNING 22 import com.android.systemui.log.dagger.NotificationLog 23 import javax.inject.Inject 24 25 class NotifBindPipelineLogger @Inject constructor( 26 @NotificationLog private val buffer: LogBuffer 27 ) { logStageSetnull28 fun logStageSet(stageName: String) { 29 buffer.log(TAG, INFO, { 30 str1 = stageName 31 }, { 32 "Stage set: $str1" 33 }) 34 } 35 logManagedRownull36 fun logManagedRow(notifKey: String) { 37 buffer.log(TAG, INFO, { 38 str1 = notifKey 39 }, { 40 "Row set for notif: $str1" 41 }) 42 } 43 logRequestPipelineRunnull44 fun logRequestPipelineRun(notifKey: String) { 45 buffer.log(TAG, INFO, { 46 str1 = notifKey 47 }, { 48 "Request pipeline run for notif: $str1" 49 }) 50 } 51 logRequestPipelineRowNotSetnull52 fun logRequestPipelineRowNotSet(notifKey: String) { 53 buffer.log(TAG, WARNING, { 54 str1 = notifKey 55 }, { 56 "Row is not set so pipeline will not run. notif = $str1" 57 }) 58 } 59 logStartPipelinenull60 fun logStartPipeline(notifKey: String) { 61 buffer.log(TAG, INFO, { 62 str1 = notifKey 63 }, { 64 "Start pipeline for notif: $str1" 65 }) 66 } 67 logFinishedPipelinenull68 fun logFinishedPipeline(notifKey: String, numCallbacks: Int) { 69 buffer.log(TAG, INFO, { 70 str1 = notifKey 71 int1 = numCallbacks 72 }, { 73 "Finished pipeline for notif $str1 with $int1 callbacks" 74 }) 75 } 76 } 77 78 private const val TAG = "NotifBindPipeline"