-
Notifications
You must be signed in to change notification settings - Fork 6
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
特性需求:多个日志记录器 & 记录附加模式 #3
Labels
Comments
每个日志记录器能够加载多个日志槽,每个日志槽可以附加到多个日志记录器,相互独立。 e.g. using namespace tinylog;
auto console = registry::instance().create_logger("console");
auto sk = console->create_sink<sink::console_sink>();
sk->set_level(debug);
sk->enable_color(false);
// 可以传递日志记录器 实例 或 名称
// \note dlout --> domain log out
dlprintf(console, info, "c style\n");
dlout("console", info) << "cpp style" << std::endl; 特定情况:默认日志记录器(兼容以前) e.g. using namespace tinylog;
auto inst = registry::instance().create_logger();
auto sk = inst->create_sink<sink::console_sink>();
sk->set_level(debug);
sk->enable_color(false);
// [可选] 不再需要传递日志记录器
lprintf(info, "c style\n");
lout(info) << "cpp style" << std::endl; |
yanminhui
added a commit
that referenced
this issue
Jun 10, 2018
受限条件:
e.g. using namespace tinylog;
auto inst = registry::instance().create_logger();
inst->create_sink<sink::basic_console_sink<char, endpage_layout>>();
lout(info) << "loading...... ";
lout(info) << "ok\f";
// output: 2018-06-10 22:22:30.123456 [INFO] #1 loading...... ok |
TODO: 记录附加模式 可以通过模式参数 |
yanminhui
added a commit
that referenced
this issue
Jun 11, 2018
- localtime_s - std::make_shared<basic_registry>()
yanminhui
added a commit
that referenced
this issue
Mar 1, 2019
yanminhui
added a commit
that referenced
this issue
Mar 1, 2019
- localtime_s - std::make_shared<basic_registry>()
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
每个日志记录器能够加载多个日志槽,每个日志槽可以附加到多个日志记录器,相互独立。
e.g.
dlout(name, level) << message << std::endl;
e.g.
The text was updated successfully, but these errors were encountered: