Skip to content

Commit d4d3fa0

Browse files
committed
style: remove un necessary new line in log
1 parent 2fc9ee6 commit d4d3fa0

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

StreamingCaptureBot.Core/Controllers/BotController.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ public async Task<ActionResult> HandleCaptureImageCommand(BotRequest request)
1818
if (!result || image is null)
1919
{
2020
// 编解码失败
21-
logger.LogError("Decode failed, send error message.");
22-
response.Message = "杰哥不要!(图像编解码失败)";
21+
logger.LogError("Capture failed, send error message.");
22+
response.Message = "杰哥不要!(图像获取失败)";
2323
}
2424
else
2525
{
@@ -29,8 +29,8 @@ public async Task<ActionResult> HandleCaptureImageCommand(BotRequest request)
2929
}
3030
catch (Exception e)
3131
{
32-
logger.LogError(e, "Failed to decode and encode.");
33-
response.Message = "你最好不要说出去,我知道你的学校和班级:\n" + e.Message + e.StackTrace;
32+
logger.LogError(e, "Failed to decode or encode.");
33+
response.Message = "你最好不要说出去,我知道你的学校和班级(图像编解码崩溃)\n" + e.Message + e.StackTrace;
3434
}
3535
finally
3636
{

StreamingCaptureBot.Core/Services/CaptureService.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ public void DecodeNextFrameUnsafe()
233233
{
234234
// 解码失败
235235
var error = new TaskCanceledException("Decode timeout.");
236-
_logger.LogError(error, "Failed to decode.\n");
236+
_logger.LogError(error, "Failed to decode.");
237237

238238
throw error;
239239
}
@@ -314,11 +314,11 @@ private void FlushDecoderBufferUnsafe(CancellationToken cancellationToken)
314314
var captureTimeSpan = DateTime.Now - LastCaptureTime;
315315
if (LastCapturedImage != null && captureTimeSpan < _streamOption.Value.CacheTimeout)
316316
{
317-
_logger.LogInformation("Return image cached {time} ago.", captureTimeSpan);
317+
_logger.LogInformation("Return image cached {time:c} ago.", captureTimeSpan);
318318
return (true, LastCapturedImage);
319319
}
320320

321-
_logger.LogInformation("Image cached {time} ago has expired, capture new.", captureTimeSpan);
321+
_logger.LogInformation("Image cached {time:c} ago has expired, capture new.", captureTimeSpan);
322322

323323
OpenInput();
324324

0 commit comments

Comments
 (0)