Files
openide/java/java-impl/src/com/intellij/lang/logging/UnspecifiedLogger.kt
Georgii Ustinov 7ac54248fe [Java. Logging] Exclude lombok and common logger independently
IDEA-345098

GitOrigin-RevId: 6d9ae6ffbd032a15567505b6e949bd4bba58ef80
2024-02-15 17:18:28 +00:00

35 lines
1.3 KiB
Kotlin

// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package com.intellij.lang.logging
import com.intellij.openapi.module.Module
import com.intellij.openapi.project.Project
import com.intellij.psi.PsiClass
import com.intellij.psi.PsiElement
/**
* This class represents logger which user has after creation of the project. This is fake logger which is only necessary to support
* "unspecified" state, e.g. where there is no preferred logger selected.
*/
class UnspecifiedLogger : JvmLogger {
override val loggerTypeName: String = "Unspecified"
override val priority: Int = 1000
override fun isOnlyOnStartup() = true
override fun insertLoggerAtClass(project: Project,
clazz: PsiClass,
logger: PsiElement): PsiElement = throw UnsupportedOperationException()
override fun isAvailable(project: Project?): Boolean = false
override fun isAvailable(module: Module?): Boolean = false
override fun isPossibleToPlaceLoggerAtClass(clazz: PsiClass): Boolean = false
override fun createLogger(project: Project, clazz: PsiClass): PsiElement = throw UnsupportedOperationException()
override fun toString(): String = UNSPECIFIED_LOGGER_NAME
companion object {
const val UNSPECIFIED_LOGGER_NAME: String = "Unspecified"
}
}