mirror of
https://github.com/Nanaloveyuki/BitLogger.git
synced 2026-07-27 10:22:18 +00:00
♻️ sync owner migration and facade thinning
This commit is contained in:
@@ -0,0 +1,96 @@
|
||||
// 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",
|
||||
"maria/json_parser",
|
||||
}
|
||||
|
||||
// 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_parser.JsonValue
|
||||
|
||||
pub fn parse_logger_config_text(String) -> LoggerConfig raise ConfigError
|
||||
|
||||
pub fn queue_config_to_json(QueueConfig) -> @json_parser.JsonValue
|
||||
|
||||
pub fn sink_config_to_json(SinkConfig) -> @json_parser.JsonValue
|
||||
|
||||
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_parser.JsonValue
|
||||
|
||||
// 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
|
||||
|
||||
Reference in New Issue
Block a user