HomePhabricator

logging: Add severity level to logs.

Description

logging: Add severity level to logs.

Summary:
Overview: This PR introduces a new macro, LogPrintLevel, that allows developers to add logs with the severity level. Additionally, it will also print the log category if it is specified.

Sample log:

2022-03-04T16:41:15Z [opencon] [net:debug] trying connection XX.XX.XXX.XXX:YYYYY lastseen=2.7hrs

This is a backport of core#24464 and core#29419
https://github.com/bitcoin/bitcoin/pull/24464/commits/a8290649a6578df120a71c9493acdf071e010d96
https://github.com/bitcoin/bitcoin/pull/29419/commits/d3b3af90343b7671231afd7dff87e87ff86d31d7 (dedup category names and improve logging.cpp)
https://github.com/bitcoin/bitcoin/pull/24464/commits/e11cdc930375eaec8d737e116138b2f2018c099f

Test Plan: ninja all check-all

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Subscribers: Fabien

Differential Revision: https://reviews.bitcoinabc.org/D17217

Details

Provenance
klementtan <klementtan@gmail.com>Authored on Mar 2 2022, 08:34
PiRKCommitted on Fri, Nov 29, 09:28
PiRKPushed on Fri, Nov 29, 09:28
Reviewer
Restricted Project
Differential Revision
D17217: logging: Add severity level to logs.
Parents
rABCe8e4f82ea3a6: [chronik] test for the "Wiping existing scripthash index" log message
Branches
Unknown
Tags
Unknown