From 676667da4117509484cfde90eab90b2f4e2d3e8c Mon Sep 17 00:00:00 2001 From: Bailey Chittle Date: Fri, 17 Feb 2023 10:43:25 -0500 Subject: [PATCH] custom tessonics readme --- README.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/README.md b/README.md index 9f6291b9..e643620f 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,22 @@ Very fast, header-only/compiled, C++ logging library. [![ci](https://github.com/gabime/spdlog/actions/workflows/ci.yml/badge.svg)](https://github.com/gabime/spdlog/actions/workflows/ci.yml)  [![Build status](https://ci.appveyor.com/api/projects/status/d2jnxclg20vd0o50?svg=true&branch=v1.x)](https://ci.appveyor.com/project/gabime/spdlog) [![Release](https://img.shields.io/github/release/gabime/spdlog.svg)](https://github.com/gabime/spdlog/releases/latest) +## ATTRIBUTES +this is a custom Tessonics fork so that we can add attributes directly to any spdlog logger object. + +example: +```c++ +// push/pop attributes +logger->push_context({{"key", "value"}}); +logger->info("message"); +logger->pop_context(); +``` + +message looks like: `message | key=value` + +refer to https://github.com/tessonics/structured_logging_cpp to see how to use this feature properly. +(make sure it is exception / thread safe, emit json logs, etc.) + ## Install #### Header only version Copy the include [folder](https://github.com/gabime/spdlog/tree/v1.x/include/spdlog) to your build tree and use a C++11 compiler.