Skip to content

Commit

Permalink
Improve logging
Browse files Browse the repository at this point in the history
  • Loading branch information
eduherminio committed Jan 18, 2025
1 parent 240eb52 commit 4b4cfaa
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/Lynx/Search/IDDFS.cs
Original file line number Diff line number Diff line change
Expand Up @@ -253,8 +253,8 @@ private SearchResult IDDFS(bool isPondering, CancellationToken cancellationToken
catch (Exception e) when (e is not LynxException)
{
_logger.Error(e,
"[#{EngineId}] Depth {Depth}: unexpected error ocurred during the search of position {Position}, best move will be returned\n{StackTrace}",
_id, depth, Game.PositionBeforeLastSearch.FEN(), e.StackTrace);
"[#{EngineId}] Depth {Depth}: unexpected error ocurred during the search of position {Position}, best move will be returned\n",
_id, depth, Game.PositionBeforeLastSearch.FEN());
}
finally
{
Expand Down
8 changes: 6 additions & 2 deletions src/Lynx/Search/NegaMax.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ private int NegaMax(int depth, int ply, int alpha, int beta, bool cutnode, Cance
// Prevents runtime failure in case depth is increased due to check extension, since we're using ply when calculating pvTable index,
if (ply >= Configuration.EngineSettings.MaxDepth)
{
_logger.Info("Max depth {0} reached", Configuration.EngineSettings.MaxDepth);
_logger.Info("[#{EngineId}] Max depth {Depth} reached",
_id, Configuration.EngineSettings.MaxDepth);

return position.StaticEvaluation(Game.HalfMovesWithoutCaptureOrPawnMove, _pawnEvalTable).Score;
}

Expand Down Expand Up @@ -534,7 +536,9 @@ public int QuiescenceSearch(int ply, int alpha, int beta, CancellationToken canc

if (ply >= Configuration.EngineSettings.MaxDepth)
{
_logger.Info("Max depth {0} reached", Configuration.EngineSettings.MaxDepth);
_logger.Info("[#{EngineId}] Max depth {Depth} reached",
_id, Configuration.EngineSettings.MaxDepth);

return position.StaticEvaluation(Game.HalfMovesWithoutCaptureOrPawnMove, _pawnEvalTable).Score;
}

Expand Down

0 comments on commit 4b4cfaa

Please sign in to comment.