重构: 源码文件蛇形命名, 接口去I头(BindRequestContext/SimApiAuthChecker), 清理C#相关说明, serialization依赖路径改 serialization-cj
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Copyright (c) 2025 SimcuTeam. All rights reserved.
|
||||
* 移植自 C# 项目 SimApi(E:\simcu\simapi-net),遵循 MIT 许可证。
|
||||
* 遵循 MIT 许可证。
|
||||
*/
|
||||
|
||||
package simcu::simapi.logger
|
||||
@@ -11,7 +11,7 @@ import std.time.*
|
||||
import soulsoft_extensions_logging.*
|
||||
|
||||
/**
|
||||
* SimApi 日志记录器:输出格式对齐 C# 原版 SimApiLogger。
|
||||
* SimApi 日志记录器。
|
||||
* 格式:`[ 分类 ][ 时间 ][ 级别 ]\n消息\n[异常]`
|
||||
* 按日志级别着色输出。
|
||||
*/
|
||||
@@ -39,7 +39,7 @@ public class SimApiLogger <: ILogger {
|
||||
sb.append("${ex}\n")
|
||||
}
|
||||
sb.append(resetColor())
|
||||
// 对齐 C# Console.WriteLine:message 末尾 \n 之后再补一个 \n,形成空行分隔
|
||||
// message 末尾 \n 之后再补一个 \n,形成空行分隔
|
||||
sb.append("\n")
|
||||
|
||||
let writer = getStdOut()
|
||||
@@ -52,7 +52,7 @@ public class SimApiLogger <: ILogger {
|
||||
}
|
||||
|
||||
/**
|
||||
* 级别名称,对齐 C# 的 LogLevel.ToString()。
|
||||
* 级别名称。
|
||||
*/
|
||||
private static func levelName(logLevel: LogLevel): String {
|
||||
match (logLevel) {
|
||||
@@ -67,7 +67,7 @@ public class SimApiLogger <: ILogger {
|
||||
}
|
||||
|
||||
/**
|
||||
* 级别对应 ANSI 前景色(对齐 C# ConsoleColor):
|
||||
* 级别对应 ANSI 前景色:
|
||||
* Debug→DarkMagenta, Info→DarkCyan, Warn→Yellow, Error→Red, Fatal→DarkRed, 其他→White
|
||||
*/
|
||||
private static func levelColor(logLevel: LogLevel): String {
|
||||
Reference in New Issue
Block a user