Skip to content

Commit

Permalink
Merge pull request #13 from dotnet-campus/t/walterlv/argument-exception
Browse files Browse the repository at this point in the history
修复日志记录移动到头导致的问题
  • Loading branch information
lindexi authored Jun 6, 2024
2 parents 2a8a863 + c09837d commit 2f19dd6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/dotnetCampus.Logger/Writers/ConsoleLogger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,10 @@ private void ClearAndMoveToLastLine(int repeatCount)
// 如果多次尝试失败,则认为当前控制台缓冲区不支持光标移动,遂放弃。
_isCursorMovementEnabled--;
}
catch (ArgumentException)
{
// 日志记录时,有可能已经移动到头了,就不要移动了。
}
}
}

Expand Down

0 comments on commit 2f19dd6

Please sign in to comment.