Skip to content

Commit

Permalink
Remove logging which was dominating the log
Browse files Browse the repository at this point in the history
  • Loading branch information
aeshub committed Oct 20, 2022
1 parent a4160cb commit c621d78
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions backend/api/Controllers/RobotController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ public class RobotController : ControllerBase
private readonly IEchoService _echoService;
private readonly IMissionService _missionService;


public RobotController(
ILogger<RobotController> logger,
IRobotService robotService,
Expand Down Expand Up @@ -47,11 +46,9 @@ IMissionService missionService
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
public async Task<ActionResult<IList<Robot>>> GetRobots()
{
_logger.LogInformation("Getting robots from database");
try
{
var robots = await _robotService.ReadAll();
_logger.LogInformation("Successful GET of robots from database");
return Ok(robots);
}
catch (Exception e)
Expand Down Expand Up @@ -343,7 +340,10 @@ [FromRoute] string missionId
{
if (e.StatusCode.HasValue && (int)e.StatusCode.Value == 404)
{
_logger.LogWarning("Could not find echo mission with id={id}", mission.EchoMissionId);
_logger.LogWarning(
"Could not find echo mission with id={id}",
mission.EchoMissionId
);
return NotFound("Echo mission not found");
}

Expand Down Expand Up @@ -390,7 +390,8 @@ [FromRoute] string missionId
}
catch (RobotPositionNotFoundException e)
{
string message = "A suitable robot position could not be found for one or more of the desired tags";
string message =
"A suitable robot position could not be found for one or more of the desired tags";
_logger.LogError(e, "{message}", message);
return StatusCode(StatusCodes.Status500InternalServerError, message);
}
Expand Down

0 comments on commit c621d78

Please sign in to comment.