Skip to content

Commit 2f19dd6

Browse files
authored
Merge pull request #13 from dotnet-campus/t/walterlv/argument-exception
修复日志记录移动到头导致的问题
2 parents 2a8a863 + c09837d commit 2f19dd6

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/dotnetCampus.Logger/Writers/ConsoleLogger.cs

+4
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,10 @@ private void ClearAndMoveToLastLine(int repeatCount)
170170
// 如果多次尝试失败,则认为当前控制台缓冲区不支持光标移动,遂放弃。
171171
_isCursorMovementEnabled--;
172172
}
173+
catch (ArgumentException)
174+
{
175+
// 日志记录时,有可能已经移动到头了,就不要移动了。
176+
}
173177
}
174178
}
175179

0 commit comments

Comments
 (0)