Skip to content

【建议】关于直播挂时长的INF日志的精简 #709

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
ZGLinus opened this issue May 7, 2024 · 4 comments
Open

【建议】关于直播挂时长的INF日志的精简 #709

ZGLinus opened this issue May 7, 2024 · 4 comments
Labels
enhancement New feature or request

Comments

@ZGLinus
Copy link

ZGLinus commented May 7, 2024

建议内容:
我发现我的两个账号在挂直播时长时,一个新号可以正常推送到我的自定义api里面,另外一个比较老的不行,因为后面的这个账号需要完成13个直播间的挂时长,每一个直播间需要在日志的information打印出70个心跳包发送成功,也就是说,光是打印心跳包发送成功,就用了910行日志,我觉得,不管是自定义API或者其他的推送服务都不支持那么多行数信息。
如果加入选项,可以控制心跳包发送成功的日志是否打印在information,这910行日志可以精简为几行“第几个心跳包发送失败”或者一行“心跳包全部发送成功”,这肯定可以大大提高发送成功的概率。

@RayWangQvQ RayWangQvQ added the enhancement New feature or request label May 7, 2024
@bugroom
Copy link

bugroom commented May 11, 2024

可以这样显示心跳包日志(其他粉丝牌升级项目中看到的):up1 up2 up3 up4等共 n 个直播间的第n次心跳包已发送(n/65)

@Polaris-cn10086
Copy link
Contributor

改成只在发送心跳包错误的时候打印Error级别的日志,成功的时候不打印日志如何呢?

if (heartBeatResult == null || heartBeatResult.Code != 0)
                    {
                        _logger.LogError("【心跳包】直播间 {room} 的第 {index} 个心跳包发送失败", info.RoomId, info.HeartBeatCount);
                        _logger.LogError("【原因】{message}", heartBeatResult != null ? heartBeatResult.Message : "");
                        info.FailedTimes += 1;
                        continue;
                    }

                    info.HeartBeatCount += 1;
                    info.FailedTimes = 0;

                    // _logger.LogInformation("【直播间】{roomId} 的第 {index} 个心跳包发送成功", info.RoomId, info.HeartBeatCount);

@RayWangQvQ
Copy link
Owner

什么都不输出会不会让人觉得卡住了

@bugroom
Copy link

bugroom commented Jun 25, 2024

什么都不输出会不会让人觉得卡住了

等等,貌似陷入了思维误区。心跳包日志输出在控制台或日志中照常输出就是了,只需要优化修改代码中发送推送服务时的信息集合只包含签到挂满时长成功与错误信息就好了,而不需要把心跳包信息放进信息集合中

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants