Package-level declarations
Types
Base class for public Logger API. Extend to implement your own logger API.
Basic LogWriter. Statements are sent to println.
Single-line string with severity, tag, and message.
Config info for all Logger instances
Implement message format for log writer. Some platforms have native support for either severity or tags. A formatter should ignore those parameters for relevant platforms. For example, on Android both tag and severity are part of the logging API. However, in JavaScript, while severity is part of the API, tags are not.
Config that can be updated. The global Logger instance needs mutable state. Most logging use cases do not, however there are some situations that may. Mutable config is less performant because state needs to be thread safe, which means volatile in the jvm and atomic in native. Each log call must access mutable, cross-thread state.
Tags are a formal part of Android, but not other systems. This formatter omits them.
Legacy logger, using NSLog
Write log statements to darwin oslog.
Just logs the message.
Immutable LoggerConfig. Access is thread safe because state is immutable. Use this is you are worried about logging performance.
Development-focused LogWriter. Will write a colored emoji according to Severity, and write the Throwable stack trace to println rather than oslog, as oslog will cut off long strings.
Functions
Factory function to create a StaticConfig
Factory function to return a default LogWriter for each platform. The LogWriter is targeted at local development. For production implementations, you may need to directly initialize your Logger config.