fun isEnabled()

in agent-sdk/src/main/java/co/elastic/otel/android/logging/LoggingPolicy.kt [32:67]


    fun isEnabled(): Boolean

    /**
     * If logging is enabled, this value will be checked later to filter which logs will
     * get printed. Logs with at least the level provided here or higher will pass, other ones (below the level provided here) will be ignored.
     */
    fun getMinimumLevel(): LogLevel

    companion object {
        /**
         * Provides the default logging policy which will log all the [LogLevel]s on debuggable applications
         * and only logs from level INFO and above for non-debuggable applications.
         *
         *
         * No logs will be created until the Agent is initialized.
         */
        internal fun getDefault(serviceManager: ServiceManager): LoggingPolicy {
            return DefaultLoggingPolicy.create(serviceManager)
        }

        /**
         * Convenience method for creating an enabled logging policy with a static minimum level.
         *
         * @param minimumLevel - The minimum [LogLevel], all the logs with this level and above will get printed, others will be ignored.
         */
        fun enabled(minimumLevel: LogLevel): LoggingPolicy {
            return SimpleLoggingPolicy(true, minimumLevel)
        }

        /**
         * Convenience method for creating a policy that disables all internal logs.
         */
        fun disabled(): LoggingPolicy {
            return SimpleLoggingPolicy(false, LogLevel.TRACE)
        }
    }