fix: 空日志行会缺失日志前缀
This commit is contained in:
1 parent
a10ec00951
commit
347a51f9d4
1 file changed
+1
@@ -213,6 +213,7 @@ public class BaseLogger {
|
||||
/// </summary>
|
||||
public virtual string Format(string text, LogLevel level, string filePath, Exception? ex) {
|
||||
string prefix = GetLogPrefix(level, filePath);
|
||||
if (string.IsNullOrEmpty(text)) return prefix;
|
||||
return text
|
||||
.ReplaceLineEndings("\n", mergeMultiple: true).Split(['\n'], StringSplitOptions.RemoveEmptyEntries)
|
||||
.Select(t => prefix + t)
|
||||
|
||||
Reference in new issue
Block a user