Library / SDK
SergiusTheBest/plog avatar
SergiusTheBest/plog

Plog's feature list and its architecture section disagree about how many appenders exist

Portable, simple and extensible C++ logging library

2,600 stars408 forksC++MIT

At a glance

What is it?
A header-only C++ logging library of about a thousand lines, integrated by copying a directory or adding a submodule, with four ways to write a log message and a sample output block dated 2015.
Who is it for?
Plog fits a C++ project that wants structured logs from a dependency it can read in an afternoon, especially one that needs CSV output, wide strings or a shared logger across a DLL boundary, since those are the three things it says it does that the larger libraries it was written against do not. It does not fit a project already standardised on another logging library, because its short LOGD macros exist precisely because they collide.
Can I use it commercially?
Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository received new commits within the last day.
What is it written in?
Mainly C++, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on November 15, 2026, and from our analysis. They are not legal advice.

From daily snapshots

Star history

  • SergiusTheBest/plog2,600 ★ · +5
Star history
Repository2026-09-292026-11-15
SergiusTheBest/plog2.6k2.6k

5 Stars in the last 47 days, measured from the daily GitHub snapshot. Compare with other projects

Editorial analysis

Three CI systems, no homepage, and two-year gaps between releases

The subtitle under the title is the pitch: a pretty powerful logging library in about 1000 lines of code, which matches the features list entry that puts the size at slightly more than 1000 lines. Three badges follow it, one per continuous integration system, pointing at a GitHub Actions workflow, an AppVeyor project on the master branch, and CircleCI. The tree explains the split: there is a .github/ directory, an .appveyor.yml file and a .circleci/ directory, which is the older pattern of covering Windows on one service and the rest on another rather than a single matrix.

The release history is three entries with an uneven cadence. 1.1.9 was published on 2022-12-16, 1.1.10 on 2023-08-20, and 1.1.11 on 2025-08-10. The first two are separated by eight months and the last two by two years, so the project publishes when there is something to publish rather than on a calendar. The recorded last commit on the default branch is dated 2026-08-07, roughly a year after that newest release.

The package is MIT licensed and the repository declares no homepage. What it does declare at the root is a spread of packaging files for different consumers: library.json for PlatformIO, plog.nuspec for NuGet, and plog.targets for MSBuild, next to CMakeLists.txt, include/, samples/, test/ and doc/.

Four integration routes, and the include path is the same in the first two

Plog is header-only, so there is nothing to build or link. The README says you add the headers to your include path and offers four ways to get them there.

The first is copying the plog directory into your source tree. The layout it draws places it under src/3rd-party/plog, with include/ inside it next to the LICENSE and the README, and the instruction is to add src/3rd-party/plog/include to the project's include directories. The second is a git submodule, which keeps the version trackable:

bash
git submodule add https://github.com/SergiusTheBest/plog.git src/3rd-party/plog
git commit -m "Add plog as a submodule"

Both land in the same directory with the same include path, so the choice is purely about upgrades: a copy has no update story, a submodule has one and adds a commit to your history when you bump it.

The third route is CMake, with two mechanisms given separately, add_subdirectory for a vendored copy and FetchContent for letting CMake pull it at configure time. The fourth is package managers, which is what the NuGet spec, the PlatformIO manifest and the MSBuild targets at the root serve.

What none of the four changes is the header path itself, so code written against one route compiles unchanged after another.

The summary says seven appenders, the architecture section documents eight

The library is organised as four pieces. A Logger is what you write through, a Record carries the data for one message, a Formatter turns a record into text, and a Converter post-processes that text, with an Appender deciding where it goes. The extension points follow the same split: custom data type, custom appender, custom formatter, custom converter.

The interesting part is that the two places that enumerate these do not match. The features summary lists four formatters, TXT, CSV, FuncMessage and MessageOnly, and seven appenders, RollingFile, Console, ColorConsole, Android, EventLog, DebugOutput and Dynamic. The architecture section lists six formatters and eight appenders. The extra two formatters are the UTC variants, TxtFormatterUtcTime and CsvFormatterUtcTime, which exist because the library can use UTC or local time and needed a separate class rather than a flag. The extra appender is ArduinoAppender.

So a reader who takes the features list as the inventory misses an entire appender. It is a small discrepancy, and it points at a real structural fact: the UTC support is implemented as duplicate classes rather than as an option, which is why the count doubled.

The samples directory confirms the wider surface. Among its twenty-four entries are Android, Arduino, AscDump, Chained, ColorConsole, CustomAppender, CustomConverter, CustomFormatter, CustomType, DebugOutput, Demo, DisableLogging, DynamicAppender, EventLog, Facilities, FreeRTOS, Hello, HexDump, Library, MessagePrefix, MultiAppender and MultiInstance, plus CXX11 and CXX17 builds.

Three macro spellings, and the short one exists because it collides

The hello sample writes the same message three ways in a row: the short macro PLOGD, the long macro PLOG_DEBUG, and the function-style PLOG(plog::debug). A fourth form, LOGD, appears immediately after with a comment saying the LOG_XXX macro may clash with other logging libraries.

That is the whole reason for the variety. This is a library that competes for a global namespace with other logging libraries on the same binary, so it offers a prefixed short form for people who like brevity, a prefixed long form for people who want it spelled out, a function-style form that takes the severity as an argument, and an unprefixed form for codebases that expect it. The table of contents carries a section named for the clash itself, so the collision is treated as a documented hazard rather than an accident.

Two more mechanisms sit in the miscellaneous notes. One lets every message carry a caller-supplied prefix, which is what the MessagePrefix sample demonstrates. The other disables logging altogether to reduce binary size, which is what the DisableLogging sample demonstrates, and for a library whose selling point is a thousand lines, a switch that removes it from the build is a coherent thing to ship.

The sample output in the README is dated 2015

The sample prints its result inline, and the timestamps are from 2015:

code
2015-05-18 23:12:43.921 DEBUG [21428] [main@13] Hello log!
2015-05-18 23:12:43.968 DEBUG [21428] [main@14] Hello log!
2015-05-18 23:12:43.968 DEBUG [21428] [main@15] Hello log!

Three lines, because three macro calls were made, and the columns show what the default text format carries: a date and time with milliseconds, the severity, a bracketed number that looks like a thread or process id, and a bracketed thread name with a line number. The line numbers advance 13, 14 and 15 in step with the three calls, which is what makes the field useful for tracing a message back to source.

Two of the three lines share a millisecond, which is also worth noticing: the second and third differ only in the line number, so the format does not guarantee distinguishable timestamps for adjacent messages.

The code block above the output ends partway through the comment on its last line, at the word introducing the unprefixed macro, so the closing lines of that sample are not shown even though the output they produce is.

One feature is compiler-specific, and it is the this-pointer capture

The features list is otherwise a portability statement: cross-platform across Windows, Linux, FreeBSD, macOS, Android, RTEMS and FreeRTOS, with gcc, clang, msvc, mingw, mingw-w64, icc and c++builder named as compilers, thread and type safe, no third-party dependencies, headers only, Unicode aware with files stored in UTF-8 and support for Utf8Everywhere, no windows.h dependency, UTC or local time, buffers printable in HEX or ASCII, and std containers printable directly.

There is exactly one exception in that list, and the README marks it. Automatic this-pointer capture is supported only on msvc. Everything else is presented as available everywhere.

Two more entries pull against each other. The library says it does not require C++11, while the samples directory ships separate CXX11 and CXX17 sample directories alongside a plain one. Those directories are about what your compiler can build the samples with, not about what the headers require, and a project with a C++17 toolchain can still use the library in C++03 mode.

The wide string support is listed alongside CSV as one of the two unique features the library offers over existing larger libraries, which is the concrete reason to choose it when a log has to carry non-ASCII text or be machine-parsed.

Sharing a logger across a DLL boundary is its own section

The advanced usage half of the README is organised around the cases where a single logger has to be seen by more than one piece of code. There is a section on changing severity at runtime, one on custom initialization, one on multiple appenders and one on multiple loggers.

The one with the most engineering in it is sharing log instances across modules, named for the four artefact types it has to work with, an executable, a dll, a shared object and a dylib. On Windows a library boundary means separate copies of global state unless something is done about it, so this is the section that matters most for a program split across a plugin interface.

Chained loggers sit beside it. A chain forwards a record to another logger as well as handling it, which is how one call reaches a file and a console, and the Chained, MultiAppender and MultiInstance samples exist to demonstrate it. Multiple appenders is the simpler version of the same idea: one logger, several destinations.

Initialisation follows the same split. There is a rolling-file initializer, a console initializer, and a manual path through Init.h for when neither default fits, which is what the Library and Facilities samples exercise.

Editorial conclusion

Plog fits a C++ project that wants structured logs from a dependency it can read in an afternoon, especially one that needs CSV output, wide strings or a shared logger across a DLL boundary, since those are the three things it says it does that the larger libraries it was written against do not. It does not fit a project already standardised on another logging library, because its short LOGD macros exist precisely because they collide. Three things to check before adopting it. First, whether you need the automatic this-pointer capture, since that feature is supported only on msvc and nothing else in the library is compiler-specific. Second, whether your build needs the MSBuild targets and the NuGet spec that sit at the root, or whether you are taking the headers by hand. Third, how you will vendor it: a copy has no upgrade path, a submodule does, and the include path is the same either way. And note that the newest release is 1.1.11 from August 2025 while the default branch has been committed to as recently as August 2026, so the branch is ahead of anything you can pin.

Frequently asked questions

How do I add plog to a C++ project?

Plog is header-only, so there is nothing to build or link. The README gives four routes: copy the plog directory into your tree and add its include directory to the include path, add it as a git submodule to the same location, use CMake with add_subdirectory or FetchContent, or install it with a package manager. The copying and submodule routes both land at src/3rd-party/plog.

What log formats and destinations does plog provide?

The features list names TXT, CSV, FuncMessage and MessageOnly formatters, and RollingFile, Console, ColorConsole, Android, EventLog, DebugOutput and Dynamic appenders. The architecture section documents two more formatters, the UTC variants of the text and CSV ones, and one more appender, ArduinoAppender.

Which C++ standard does plog require?

The README states that it does not require C++11. Its portability claim covers Windows, Linux, FreeBSD, macOS, Android, RTEMS and FreeRTOS with gcc, clang, msvc, mingw, mingw-w64, icc and c++builder. The samples directory ships CXX11 and CXX17 variants as well as a plain one.

Why does plog offer several logging macros?

The hello sample writes the same message three ways, with a short macro, a long macro and a function-style macro taking the severity as an argument. A fourth unprefixed LOG_XXX form is included with a comment noting that it may clash with other logging libraries, and the README has a section devoted to that clash.

Official sources

  1. Issues
  2. License: MIT
  3. README
  4. Releases
  5. SergiusTheBest/plog on GitHub
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/sergiusthebest-plog.svg)](https://hysenlabs.com/projects/sergiusthebest-plog)

Star history chart for your README

markdown
[![Star history](https://hysenlabs.com/chart/sergiusthebest-plog.svg)](https://hysenlabs.com/projects/sergiusthebest-plog)

Was this useful?