From c09837d4e536e8ffb490be5f5d34bc8ea4a1b592 Mon Sep 17 00:00:00 2001 From: walterlv Date: Thu, 6 Jun 2024 12:05:27 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=97=A5=E5=BF=97=E8=AE=B0?= =?UTF-8?q?=E5=BD=95=E7=A7=BB=E5=8A=A8=E5=88=B0=E5=A4=B4=E5=AF=BC=E8=87=B4?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/dotnetCampus.Logger/Writers/ConsoleLogger.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/dotnetCampus.Logger/Writers/ConsoleLogger.cs b/src/dotnetCampus.Logger/Writers/ConsoleLogger.cs index d068249..499daaa 100644 --- a/src/dotnetCampus.Logger/Writers/ConsoleLogger.cs +++ b/src/dotnetCampus.Logger/Writers/ConsoleLogger.cs @@ -170,6 +170,10 @@ private void ClearAndMoveToLastLine(int repeatCount) // 如果多次尝试失败,则认为当前控制台缓冲区不支持光标移动,遂放弃。 _isCursorMovementEnabled--; } + catch (ArgumentException) + { + // 日志记录时,有可能已经移动到头了,就不要移动了。 + } } }