当前位置:网站首页>Boost study: boost log
Boost study: boost log
2022-06-30 11:46:00 【JiNan. YouQuan. Soft】
The log system is used to record the key information during software operation , It's big CAx An important component of a software system .
This paper intends to Boost.Log Module for analysis , To record its technical points .
notes 1: Limited to the author's research level , It is hard to avoid misunderstanding , Welcome criticism and correction .
notes 2: The content of the article will be updated from time to time , Welcome to exchange and discussion .
One 、 working principle
Boost.Log In general, the Logging Sources、Logging Core、Logging Sinks Other components :Logging Sources establish log records;Logging Core Yes log records To deal with ;Logging Sinks Complete the final formatting and output .
Ref. from Boost.Log Design Overview
Logging sources
Getting back to the figure, in the left side your application emits log records with help of loggers - special objects that provide streams to format messages that will eventually be put to log. The library provides a number of different logger types and you can craft many more yourself, extending the existing ones. Loggers are designed as a mixture of distinct features that can be combined with each other in any combination. You can simply develop your own feature and add it to the soup. You will be able to use the constructed logger just like the others - embed it into your application classes or create and use a global instance of the logger. Either approach provides its benefits. Embedding a logger into some class provides a way to differentiate logs from different instances of the class. On the other hand, in functional-style programming it is usually more convenient to have a single global logger somewhere and have a simple access to it.
Generally speaking, the library does not require the use of loggers to write logs. The more generic term "log source" designates the entity that initiates logging by constructing a log record. Other log sources might include captured console output of a child application or data received from network. However, loggers are the most common kind of log sources.
Logging core and filtering
When the set of attribute values is composed, the logging core decides if this log record is going to be processed in sinks. This is called filtering. There are two layers of filtering available: the global filtering is applied first within the logging core itself and allows quickly wiping away unneeded log records; the sink-specific filtering is applied second, for each sink separately. The sink-specific filtering allows directing log records to particular sinks. Note that at this point it is not significant which logging source emitted the record, the filtering relies solely on the set of attribute values attached to the record.
Sinks and formatting
If a log record passes filtering for at least one sink the record is considered to be consumable. If the sink supports formatted output, this is the point when log message formatting takes place. The formatted message along with the composed set of attribute values is passed to the sink that accepted the record. Note that formatting is performed on the per-sink basis so that each sink can output log records in its own specific format.

Reference material
Boost.Log
https://www.boost.org/doc/libs/1_79_0/libs/log/doc/html/index.html
边栏推荐
- Wechat Emoji is written into the judgment, and every Emoji you send may become evidence in court
- HMS core audio editing service 3D audio technology helps create an immersive auditory feast
- 10 days to learn how to flutter Day10 flutter play animation and packaging
- Summer vacation study record
- 再不上市,旷视科技就熬不住了
- What is a wechat applet that will open the door of the applet
- 他是上海两大产业的第一功臣,却在遗憾中默默离世
- 数据库连接池 druid
- 揭秘得物客服IM全链路通信过程
- Typescript readonlyarray (read only array type) details
猜你喜欢

OpenMLDB Meetup No.4 会议纪要

Quel est le rôle du rétroéclairage LED?

Stm32f407zgt6 uses SDIO mode to drive SD card

AUTOCAD——LEN命令

他是上海两大产业的第一功臣,却在遗憾中默默离世
![[xi'anjiaotonguniversity] information sharing of the first and second postgraduate entrance examinations](/img/06/df5a64441814c9ecfa2f039318496e.jpg)
[xi'anjiaotonguniversity] information sharing of the first and second postgraduate entrance examinations

R language de duplication operation unique duplicate filter

Record the memory leak of viewpager + recyclerview once

科普达人丨漫画图解什么是eRDMA?

科普達人丨漫畫圖解什麼是eRDMA?
随机推荐
相对位置编码Transformer的一个理论缺陷与对策
Alibaba cloud lifeifei: China's cloud database has taken the lead in many mainstream technological innovations abroad
Win10 R package installation error: not installed in arch=i386
Evaluation of IP location query interface Ⅲ
A man is a Book
Alibaba cloud database represented by polardb ranks first in the world
Qualcomm released the "magic mirror" of the Internet of things case set, and digital agriculture has become a reality
zabbix监控TCP连接个数
10 days to learn how to flutter Day10 flutter play animation and packaging
How to 'gracefully' avoid MySQL login prompt information in scripts
60 divine vs Code plug-ins!!
ClipboardJS——开发学习总结1
数据库 事务
OpenMLDB Meetup No.4 会议纪要
【小程序实战系列】小程序框架 页面注册 生命周期 介绍
Flutter 从零开始 004 按钮组件
阿里云李飞飞:中国云数据库在很多主流技术创新上已经领先国外
Object mapping - mapping Mapster
In depth analysis of Apache bookkeeper series: Part 4 - back pressure
脚本中如何'优雅'避免MySQL登录提示信息