mirror of
https://github.com/Nanaloveyuki/BitLogger.git
synced 2026-07-23 16:32:19 +00:00
🔧 support MoonBit 0.10.4
This commit is contained in:
@@ -6,6 +6,4 @@ import {
|
|||||||
|
|
||||||
supported_targets = "+native"
|
supported_targets = "+native"
|
||||||
|
|
||||||
options(
|
pkgtype(kind: "executable")
|
||||||
is_main: true,
|
|
||||||
)
|
|
||||||
|
|||||||
@@ -2,6 +2,4 @@ import {
|
|||||||
"Nanaloveyuki/BitLogger/src" @lib,
|
"Nanaloveyuki/BitLogger/src" @lib,
|
||||||
}
|
}
|
||||||
|
|
||||||
options(
|
pkgtype(kind: "executable")
|
||||||
"is-main": true,
|
|
||||||
)
|
|
||||||
|
|||||||
@@ -2,6 +2,4 @@ import {
|
|||||||
"Nanaloveyuki/BitLogger/src" @lib,
|
"Nanaloveyuki/BitLogger/src" @lib,
|
||||||
}
|
}
|
||||||
|
|
||||||
options(
|
pkgtype(kind: "executable")
|
||||||
"is-main": true,
|
|
||||||
)
|
|
||||||
|
|||||||
@@ -2,6 +2,4 @@ import {
|
|||||||
"Nanaloveyuki/BitLogger/src" @lib,
|
"Nanaloveyuki/BitLogger/src" @lib,
|
||||||
}
|
}
|
||||||
|
|
||||||
options(
|
pkgtype(kind: "executable")
|
||||||
"is-main": true,
|
|
||||||
)
|
|
||||||
|
|||||||
@@ -2,6 +2,4 @@ import {
|
|||||||
"Nanaloveyuki/BitLogger/src" @lib,
|
"Nanaloveyuki/BitLogger/src" @lib,
|
||||||
}
|
}
|
||||||
|
|
||||||
options(
|
pkgtype(kind: "executable")
|
||||||
"is-main": true,
|
|
||||||
)
|
|
||||||
|
|||||||
@@ -2,6 +2,4 @@ import {
|
|||||||
"Nanaloveyuki/BitLogger/src" @lib,
|
"Nanaloveyuki/BitLogger/src" @lib,
|
||||||
}
|
}
|
||||||
|
|
||||||
options(
|
pkgtype(kind: "executable")
|
||||||
"is-main": true,
|
|
||||||
)
|
|
||||||
|
|||||||
@@ -2,6 +2,4 @@ import {
|
|||||||
"Nanaloveyuki/BitLogger/src" @lib,
|
"Nanaloveyuki/BitLogger/src" @lib,
|
||||||
}
|
}
|
||||||
|
|
||||||
options(
|
pkgtype(kind: "executable")
|
||||||
"is-main": true,
|
|
||||||
)
|
|
||||||
|
|||||||
@@ -2,6 +2,4 @@ import {
|
|||||||
"Nanaloveyuki/BitLogger/src" @lib,
|
"Nanaloveyuki/BitLogger/src" @lib,
|
||||||
}
|
}
|
||||||
|
|
||||||
options(
|
pkgtype(kind: "executable")
|
||||||
"is-main": true,
|
|
||||||
)
|
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ pub fn TextFormatterConfig::new(
|
|||||||
style_markup? : @formatting.StyleMarkupMode = @formatting.StyleMarkupMode::Full,
|
style_markup? : @formatting.StyleMarkupMode = @formatting.StyleMarkupMode::Full,
|
||||||
target_style_markup? : @formatting.StyleMarkupMode = @formatting.StyleMarkupMode::Disabled,
|
target_style_markup? : @formatting.StyleMarkupMode = @formatting.StyleMarkupMode::Disabled,
|
||||||
fields_style_markup? : @formatting.StyleMarkupMode = @formatting.StyleMarkupMode::Disabled,
|
fields_style_markup? : @formatting.StyleMarkupMode = @formatting.StyleMarkupMode::Disabled,
|
||||||
style_tags? : Map[String, @formatting.TextStyle] = {},
|
style_tags? : Map[String, @formatting.TextStyle] = Map([]),
|
||||||
) -> TextFormatterConfig {
|
) -> TextFormatterConfig {
|
||||||
{
|
{
|
||||||
show_timestamp,
|
show_timestamp,
|
||||||
@@ -380,7 +380,7 @@ fn parse_text_formatter_config(
|
|||||||
get_string(obj, "fields_style_markup", default="disabled"),
|
get_string(obj, "fields_style_markup", default="disabled"),
|
||||||
),
|
),
|
||||||
style_tags=match obj.get("style_tags") {
|
style_tags=match obj.get("style_tags") {
|
||||||
None => {}
|
None => Map([])
|
||||||
Some(inner) => parse_style_tags_config(inner)
|
Some(inner) => parse_style_tags_config(inner)
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
@@ -407,7 +407,7 @@ fn parse_style_tags_config(
|
|||||||
value : @json_parser.JsonValue,
|
value : @json_parser.JsonValue,
|
||||||
) -> Map[String, @formatting.TextStyle] raise ConfigError {
|
) -> Map[String, @formatting.TextStyle] raise ConfigError {
|
||||||
let obj = expect_object(value, "text_formatter.style_tags")
|
let obj = expect_object(value, "text_formatter.style_tags")
|
||||||
let style_tags : Map[String, @formatting.TextStyle] = {}
|
let style_tags : Map[String, @formatting.TextStyle] = Map([])
|
||||||
for name, item in obj {
|
for name, item in obj {
|
||||||
style_tags[name] = parse_text_style_config(
|
style_tags[name] = parse_text_style_config(
|
||||||
item,
|
item,
|
||||||
@@ -584,7 +584,7 @@ fn text_style_config_to_json(
|
|||||||
fn style_tags_config_to_json(
|
fn style_tags_config_to_json(
|
||||||
style_tags : Map[String, @formatting.TextStyle],
|
style_tags : Map[String, @formatting.TextStyle],
|
||||||
) -> @json_parser.JsonValue {
|
) -> @json_parser.JsonValue {
|
||||||
let obj : Map[String, @json_parser.JsonValue] = {}
|
let obj : Map[String, @json_parser.JsonValue] = Map([])
|
||||||
for name, style in style_tags {
|
for name, style in style_tags {
|
||||||
obj[name] = text_style_config_to_json(style)
|
obj[name] = text_style_config_to_json(style)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ fn normalize_style_tag_name(name : String) -> String {
|
|||||||
|
|
||||||
///|
|
///|
|
||||||
pub fn style_tag_registry() -> StyleTagRegistry {
|
pub fn style_tag_registry() -> StyleTagRegistry {
|
||||||
{ entries: {} }
|
{ entries: Map([]) }
|
||||||
}
|
}
|
||||||
|
|
||||||
///|
|
///|
|
||||||
@@ -1015,7 +1015,7 @@ fn level_ansi_code(level : @core.Level) -> String {
|
|||||||
|
|
||||||
///|
|
///|
|
||||||
fn fields_to_json(fields : Array[@core.Field]) -> Json {
|
fn fields_to_json(fields : Array[@core.Field]) -> Json {
|
||||||
let obj : Map[String, Json] = {}
|
let obj : Map[String, Json] = Map([])
|
||||||
for item in fields {
|
for item in fields {
|
||||||
obj[item.key] = Json::string(item.value)
|
obj[item.key] = Json::string(item.value)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user