Skip to content
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

日志信息输出 #1

Closed
fawdlstty opened this issue May 18, 2019 · 7 comments
Closed

日志信息输出 #1

fawdlstty opened this issue May 18, 2019 · 7 comments

Comments

@fawdlstty
Copy link
Contributor

也许可以提供一种on_log方法,提供日志回调函数,便于日志记录

http_server _server (1);
_server.on_log ([] (int _errno, const char *_msg) {
    //自己的日志信息存储方式,比如LOG_INFO...
});
@xmh0511
Copy link
Owner

xmh0511 commented May 18, 2019

日志记录 用户可以通过相关的库去使用呀 每个接口中记录信息 至于具体的信息怎么存储 是由日志库决定的 这里提供全局的on_log 出于什么考虑呢

@fawdlstty
Copy link
Contributor Author

记录库的错误信息,比如
https://github.com/xmh0511/xfinal/blob/master/http_server.hpp#L81

@xmh0511
Copy link
Owner

xmh0511 commented May 18, 2019

好 这个我会加个统一处理的接口

@fawdlstty
Copy link
Contributor Author

另外这个库是否考虑加上开源协议呢?

@xmh0511
Copy link
Owner

xmh0511 commented May 18, 2019

嗯 这块还没来得及做 你是否可以提个pr

@fawdlstty
Copy link
Contributor Author

这个只有你来吧。毕竟是你的项目,看你想以怎样的方式开源咯。

@xmh0511
Copy link
Owner

xmh0511 commented May 31, 2019

server.on_error([](std::exception const& ec) {
std::cout<<ec.what()<<std::endl;
});
已提供该接口

xmh0511 pushed a commit that referenced this issue Apr 23, 2021
fix a bug that empty data caused webosocket to throw an exception
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants