- add custom LogLevel constructors and richer color configuration - support ANSI, 256-color, RGB, and text attributes on LogLevel - introduce clearer preferred APIs such as NewLogger and SetName - preserve backward compatibility with deprecated wrappers for v2.0.1 APIs - restore legacy ColorStringBuilder signatures as compatibility wrappers - fix newline separator handling in Println-style output - add tests for color precedence, deprecated aliases, and LogLevel attributes - update GoDoc and bilingual README documentation
This commit is contained in:
@@ -91,6 +91,7 @@ var strftimeToGoRules = []rule{
|
||||
{"%r", "03:04:05 PM"},
|
||||
}
|
||||
|
||||
// StrftimeToGo converts a strftime-like layout into a Go time layout.
|
||||
func StrftimeToGo(format string) string {
|
||||
var out strings.Builder
|
||||
|
||||
@@ -121,6 +122,7 @@ func StrftimeToGo(format string) string {
|
||||
return out.String()
|
||||
}
|
||||
|
||||
// GoToStrftime converts a Go time layout into an approximate strftime-like layout.
|
||||
func GoToStrftime(format string) string {
|
||||
format = strings.ReplaceAll(format, "2006", "%Y")
|
||||
format = strings.ReplaceAll(format, "06", "%y")
|
||||
|
||||
Reference in New Issue
Block a user