From 9ca8073cb27ef903e12a6894116128d21a41ef15 Mon Sep 17 00:00:00 2001 From: Sergiu Deitsch Date: Wed, 12 Jun 2024 23:58:03 +0200 Subject: [PATCH] docs: use annotations --- docs/index.md | 10 +++++----- docs/logging.md | 6 ++++-- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/docs/index.md b/docs/index.md index 465869e..a297777 100644 --- a/docs/index.md +++ b/docs/index.md @@ -13,14 +13,14 @@ You can log a message by simply streaming things to `LOG`( int main(int argc, char* argv[]) { - // Initialize Google’s logging library. - google::InitGoogleLogging(argv[0]); - - // ... - LOG(INFO) << "Found " << num_cookies << " cookies"; + google::InitGoogleLogging(argv[0]); // (1)! + LOG(INFO) << "Found " << num_cookies << " cookies"; // (2)! } ``` +1. Initialize the Google Logging Library +2. Log a message with informational severity + The library can be installed using various [package managers](packages.md) or compiled [from source](build.md). For a detailed overview of glog features and their usage, please refer to the [user guide](logging.md). diff --git a/docs/logging.md b/docs/logging.md index c6b13c3..2c64328 100644 --- a/docs/logging.md +++ b/docs/logging.md @@ -253,11 +253,13 @@ used as follows: ``` cpp if (VLOG_IS_ON(2)) { - // do some logging preparation and logging - // that can’t be accomplished with just VLOG(2) << ...; + // (1) } ``` +1. Here we can perform some logging preparation and logging that can’t be + accomplished with just `#!cpp VLOG(2) << "message ...";` + Verbose level condition macros `VLOG_IF`, `VLOG_EVERY_N` and `VLOG_IF_EVERY_N` behave analogous to `LOG_IF`, `LOG_EVERY_N`, `LOG_IF_EVERY_N`, but accept a numeric verbosity level as opposed to a severity level.