Stay organized with collections
Save and categorize content based on your preferences.
Filter
@FunctionalInterface interface Filter
A Filter can be used to provide fine grain control over what is logged, beyond the control provided by log levels.
Each Logger and each Handler can have a filter associated with it. The Logger or Handler will call the isLoggable method to check if a given LogRecord should be published. If isLoggable returns false, the LogRecord will be discarded.
Summary
Public methods |
abstract Boolean |
Check if a given log record should be published.
|
Public methods
isLoggable
abstract fun isLoggable(record: LogRecord!): Boolean
Check if a given log record should be published.
Return |
Boolean |
true if the log record should be published. |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# Filter\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nFilter\n======\n\n```\n@FunctionalInterface interface Filter\n```\n\n|-------------------------------|\n| [java.util.logging.Filter](#) |\n\nA Filter can be used to provide fine grain control over what is logged, beyond the control provided by log levels.\n\nEach Logger and each Handler can have a filter associated with it. The Logger or Handler will call the isLoggable method to check if a given LogRecord should be published. If isLoggable returns false, the LogRecord will be discarded.\n\nSummary\n-------\n\n| Public methods ||\n|---------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| abstract [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | [isLoggable](#isLoggable(java.util.logging.LogRecord))`(`record:` `[LogRecord](/reference/kotlin/java/util/logging/LogRecord)!`)` Check if a given log record should be published. |\n\nPublic methods\n--------------\n\n### isLoggable\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nabstract fun isLoggable(record: LogRecord!): Boolean\n```\n\nCheck if a given log record should be published.\n\n| Parameters ||\n|----------|--------------------------------------------------------------------------|\n| `record` | [LogRecord](/reference/kotlin/java/util/logging/LogRecord)!: a LogRecord |\n\n| Return ||\n|------------------------------------------------------------------------------------|---------------------------------------------|\n| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | true if the log record should be published. |"]]