mirror of
https://github.com/Nanaloveyuki/BitLogger.git
synced 2026-07-24 00:42:18 +00:00
96 lines
3.0 KiB
Plaintext
96 lines
3.0 KiB
Plaintext
// Generated using `moon info`, DON'T EDIT IT
|
|
package "Nanaloveyuki/BitLogger/src/config_model"
|
|
|
|
import {
|
|
"Nanaloveyuki/BitLogger/src/core",
|
|
"Nanaloveyuki/BitLogger/src/file_model",
|
|
"Nanaloveyuki/BitLogger/src/formatting",
|
|
"Nanaloveyuki/BitLogger/src/queue_model",
|
|
}
|
|
|
|
// Values
|
|
pub fn default_logger_config() -> LoggerConfig
|
|
|
|
pub fn default_sink_config() -> SinkConfig
|
|
|
|
pub fn default_text_formatter_config() -> TextFormatterConfig
|
|
|
|
pub fn logger_config_to_json(LoggerConfig) -> Json
|
|
|
|
pub fn parse_logger_config_text(String) -> LoggerConfig raise ConfigError
|
|
|
|
pub fn queue_config_to_json(QueueConfig) -> Json
|
|
|
|
pub fn sink_config_to_json(SinkConfig) -> Json
|
|
|
|
pub fn stringify_logger_config(LoggerConfig, pretty? : Bool) -> String
|
|
|
|
pub fn stringify_queue_config(QueueConfig, pretty? : Bool) -> String
|
|
|
|
pub fn stringify_sink_config(SinkConfig, pretty? : Bool) -> String
|
|
|
|
pub fn stringify_text_formatter_config(TextFormatterConfig, pretty? : Bool) -> String
|
|
|
|
pub fn text_formatter_config_to_json(TextFormatterConfig) -> Json
|
|
|
|
// Errors
|
|
pub(all) suberror ConfigError {
|
|
InvalidConfig(String)
|
|
}
|
|
|
|
// Types and methods
|
|
pub struct LoggerConfig {
|
|
min_level : @core.Level
|
|
target : String
|
|
timestamp : Bool
|
|
sink : SinkConfig
|
|
queue : QueueConfig?
|
|
}
|
|
pub fn LoggerConfig::new(min_level? : @core.Level, target? : String, timestamp? : Bool, sink? : SinkConfig, queue? : QueueConfig?) -> Self
|
|
|
|
pub struct QueueConfig {
|
|
max_pending : Int
|
|
overflow : @queue_model.QueueOverflowPolicy
|
|
}
|
|
pub fn QueueConfig::new(Int, overflow? : @queue_model.QueueOverflowPolicy) -> Self
|
|
|
|
pub struct SinkConfig {
|
|
kind : SinkKind
|
|
path : String
|
|
append : Bool
|
|
auto_flush : Bool
|
|
rotation : @file_model.FileRotation?
|
|
text_formatter : TextFormatterConfig
|
|
}
|
|
pub fn SinkConfig::new(kind? : SinkKind, path? : String, append? : Bool, auto_flush? : Bool, rotation? : @file_model.FileRotation?, text_formatter? : TextFormatterConfig) -> Self
|
|
|
|
pub(all) enum SinkKind {
|
|
Console
|
|
JsonConsole
|
|
TextConsole
|
|
File
|
|
}
|
|
|
|
pub struct TextFormatterConfig {
|
|
show_timestamp : Bool
|
|
show_level : Bool
|
|
show_target : Bool
|
|
show_fields : Bool
|
|
separator : String
|
|
field_separator : String
|
|
template : String
|
|
color_mode : @formatting.ColorMode
|
|
color_support : @formatting.ColorSupport
|
|
style_markup : @formatting.StyleMarkupMode
|
|
target_style_markup : @formatting.StyleMarkupMode
|
|
fields_style_markup : @formatting.StyleMarkupMode
|
|
style_tags : Map[String, @formatting.TextStyle]
|
|
}
|
|
pub fn TextFormatterConfig::new(show_timestamp? : Bool, show_level? : Bool, show_target? : Bool, show_fields? : Bool, separator? : String, field_separator? : String, template? : String, color_mode? : @formatting.ColorMode, color_support? : @formatting.ColorSupport, style_markup? : @formatting.StyleMarkupMode, target_style_markup? : @formatting.StyleMarkupMode, fields_style_markup? : @formatting.StyleMarkupMode, style_tags? : Map[String, @formatting.TextStyle]) -> Self
|
|
pub fn TextFormatterConfig::to_formatter(Self) -> @formatting.TextFormatter
|
|
|
|
// Type aliases
|
|
|
|
// Traits
|
|
|