Tuesday, February 5, 2019

Coming in 2019: Pantheios 1 (non-beta); Pantheios 2

Ok, so it's been a heck of a long while since Pantheios' first beta was released. The last released beta was 219 (!), on 28th January 2017. There's been a fair amount of useful work on the library since then, but not released.

(As has been obvious since the outset of its release into the world, having the first version number as 1.0.1 and then just bumping the beta was crazy optimistic, and in practice just crazy. This very aspect has hindered speed of progress, as it's worked against the principle of release early, release often.)

There's also been a lot of change in "the ideal conception of Pantheios in C/C++" in this time. There are no massive changes, but there are some important differences that will require a bump in major number, which will be outlined in posts in the near future.

Both of the above (as yet unreleased) works have arisen due to use and commercial customisations I've been doing for a client, in which Pantheios has seen tremendous use in exacting circumstances. (I say this to reassure that the project is not dead, not even resting, stunned, or pining for the fjords. It is alive, and it will be sprouting wings again into the world this year.)

So, without much further ado, the coming changes of the Pantheios project are:
  • The existing Pantheios project (1.0.1-bXXX) will be mothballed;
  • The current state of Pantheios will be effectively rendered in another project, Pantheios1;
  • The new, improved version will be rendered in another project, Pantheios2, sometime before the middle of the year. Subsequent posts will explain the new/changed features.

Sunday, September 27, 2015

Use of the showPlus format flag

Pantheios 1.0.1 beta 215 introduces the showPlus format flag, which causes leading pluses to be applied to integers (just as leading minuses will appear for negative numbers).

It is used as follows:

#include <pantheios/pan.hpp>
#include <pantheios/inserters/i.hpp>

int main()
  pan::log_INFORMATIONAL("log -10:");
  pan::log_INFORMATIONAL("without showPlus: '", pan::i(-10), "'");
  pan::log_INFORMATIONAL("with    showPlus: '", pan::i(-10, 0, pan::fmt::showPlus), "'");

  pan::log_INFORMATIONAL("log +10:");
  pan::log_INFORMATIONAL("without showPlus: '", pan::i(+10), "'");
  pan::log_INFORMATIONAL("with    showPlus: '", pan::i(+10, 0, pan::fmt::showPlus), "'");

  pan::log_INFORMATIONAL("log -10 into 10-width:");
  pan::log_INFORMATIONAL("without showPlus: '", pan::i(-10, 10, 0), "'");
  pan::log_INFORMATIONAL("with    showPlus: '", pan::i(-10, 10, pan::fmt::showPlus), "'");

  pan::log_INFORMATIONAL("log +10 into 10-width:");
  pan::log_INFORMATIONAL("without showPlus: '", pan::i(+10, 10, 0), "'");
  pan::log_INFORMATIONAL("with    showPlus: '", pan::i(+10, 10, pan::fmt::showPlus), "'");

  pan::log_INFORMATIONAL("log -10 into 10-width left-justified:");
  pan::log_INFORMATIONAL("without showPlus: '", pan::i(-10, -10, 0), "'");
  pan::log_INFORMATIONAL("with    showPlus: '", pan::i(-10, -10, pan::fmt::showPlus), "'");

  pan::log_INFORMATIONAL("log +10 into 10-width left-justified:");
  pan::log_INFORMATIONAL("without showPlus: '", pan::i(+10, -10, 0), "'");
  pan::log_INFORMATIONAL("with    showPlus: '", pan::i(+10, -10, pan::fmt::showPlus), "'");

  return 0;


which gives the output:

[test.scratch.showPlus.integer...]: log -10:
[test.scratch.showPlus.integer...]: without showPlus: '-10'
[test.scratch.showPlus.integer...]: with    showPlus: '-10'
[test.scratch.showPlus.integer...]: ----------

[test.scratch.showPlus.integer...]: log +10:
[test.scratch.showPlus.integer...]: without showPlus: '10'
[test.scratch.showPlus.integer...]: with    showPlus: '+10'
[test.scratch.showPlus.integer...]: ----------

[test.scratch.showPlus.integer...]: log -10 into 10-width:
[test.scratch.showPlus.integer...]: without showPlus: '       -10'
[test.scratch.showPlus.integer...]: with    showPlus: '       -10'
[test.scratch.showPlus.integer...]: ----------

[test.scratch.showPlus.integer...]: log +10 into 10-width:
[test.scratch.showPlus.integer...]: without showPlus: '        10'
[test.scratch.showPlus.integer...]: with    showPlus: '       +10'
[test.scratch.showPlus.integer...]: ----------

[test.scratch.showPlus.integer...]: log -10 into 10-width left-justified:
[test.scratch.showPlus.integer...]: without showPlus: '-10       '
[test.scratch.showPlus.integer...]: with    showPlus: '-10       '
[test.scratch.showPlus.integer...]: ----------

[test.scratch.showPlus.integer...]: log +10 into 10-width left-justified:
[test.scratch.showPlus.integer...]: without showPlus: '10        '
[test.scratch.showPlus.integer...]: with    showPlus: '+10       '
[test.scratch.showPlus.integer...]: ----------

GitHub access

Pantheios GitHub access now at:

Fork away!

Pantheios 1.0.1 beta 215 released

Pantheios is an open source C/C++ Logging API library, offering an optimal
combination of 100% type-safety, efficiency, genericity and extensibility.
It is simple to use and extend, highly-portable (platform and
compiler-independent) and, best of all, it upholds the C tradition of you
only pay for what you use.

Pantheios supports logging of message statements of arbitrary complexity,
consisting of heterogeneous types.

Pantheios supports filtering of log messages based on severity level
including (but not limited to) the eight levels defined by the SysLog

Pantheios supports back-end output, individually and in combination, to
stderr/stdout, SysLog (including a custom implementation of the SysLog
protocol for Windows), Windows debugger, Windows event log, COM Error
Object, Speech, or any custom back-end extension you care to write.
Importantly, Pantheios is readily extended to use the existing transport
mechanisms of feature-rich logging libraries such as ACE, log4cpp,
log4cplus, log4cxx.

Pantheios does not contain any compiler-specific or platform-specific
constructs. It supports UNIX (including Linux and Mac OS-X), and Windows,
and should work with any operating system. It is known to be compatible with
Borland (5.6+), Clang, Comeau (4.3.3+), Digital Mars (8.45+), GCC (3.4+), Intel
(7+), Metrowerks (8+), Microsoft Visual C++ (6.0+), and should work with any
reasonably modern C++ compiler.

Pantheios is completely free and includes source released under a BSD-style
license. Commercial servics, including bespoke customisations, are available
from Synesis Software Pty Ltd; http://synesis.com.au/contact.html

Pantheios Training is provided by Synesis Software Pty Ltd; details at

Release 1.0.1 beta 215 incorporates:
* added interval inserter
* added stream_character inserter
* Clang-compatibility
* VC++ 11-compatibility
* VC++ 12-compatibility
* VC++ 14-compatibility
* showPlus format flag support in pantheios::integer (pan::i)
* makefiles customisable to specify non-bundled locations of b64, shwild,
xContract, xCover, and xTests libraries (useful to getting head from GitHub)
* NOTE: Now requires STLSoft 1.9.121

Download from:

Discuss at: https://sourceforge.net/projects/pantheios/forums/forum/475313

Pantheios website: http://pantheios.org/

Note: this release of Pantheios requires STLSoft 1.9.121, or later; download
from http://stlsoft.org/

Monday, May 21, 2012

Extended Radio Silence - ending in Q3 2012

To anyone who's still following any of my public works - FastFormat, Pantheios, STLSoft, Breaking Up The Monolith, Quality Matters, VOLE, etc. - and wondering whether these activities are permanently moribund, I want to let you know that I'll soon be free of a very intense and overwhelmingly consuming commercial engagement over the last 2.5 years, and the second half of this year should see much activity in open-source, commercial, and writing activities.



Monday, January 10, 2011

Pantheios 1.0.1 beta 210 released: closing a vulnerability to badly written third-party libraries

The latest release of Pantheios - version 1.0.1 beta 210 - closes a vulnerability to implicit conversion of instances of fundamental types in the presence of badly-written third-party C++ libraries.

For reasons of robustness, Pantheios log statements do not accept instances of fundamental types - integers, floating-points, bool, char, and so on. Instead, users are advised to select from the set of stock inserter classes and functions provided with the library, or to define their own.

Consequently, and by design, statements such as the following will result in compilation errors:

  #include <pantheios/pantheios.hpp>

  pantheios::log_NOTICE("int: ", 10);

  pantheios::log_INFORMATIONAL("float: ", 1.23);

  pantheios::log_INFORMATIONAL("bool: ", true);

Instead, inserters should be used:

  #include <pantheios/pantheios.hpp>
  #include <pantheios/inserters/integer.hpp>
  #include <pantheios/inserters/real.hpp>
  #include <pantheios/inserters/boolean.hpp>

  pantheios::log_NOTICE("int: ", pantheios::integer(10));

  pantheios::log_INFORMATIONAL("float: ", pantheios::real(1.23));

  pantheios::log_INFORMATIONAL("bool: ", pantheios::boolean(true));

This can be expressed more succinctly by using namespace and inserter aliases:

  #include <pantheios/pan.hpp>
  #include <pantheios/inserters/i.hpp>
  #include <pantheios/inserters/real.hpp>
  #include <pantheios/inserters/b.hpp>

  pan::log_NOTICE("int: ", pan::i(10));

  pan::log_INFORMATIONAL("float: ", pan::real(1.23));

  pan::log_INFORMATIONAL("bool: ", pan::b(true));

Unfortunately, in the presence of ATL or MFC - or any other library that has conversion constructors and for which string access shims are defined - the former statements will compile and execute, but will not produce the expected output. Consider the following code:

#include <afx.h>
#include <pantheios/pan.hpp>

  pan::log_NOTICE("int: ", 10);

In a wide-string build in the presence of MFC, then rather than causing a compilation error, the 10 will actually be converted to an instance of CString, via the conversion constructor taking a TCHAR argument!

Obviously this is not desirable, particularly not for a diagnotic logging library! As of 1.0.1 beta 210, there are compile-time constraints in the application layer function templates - log(), log_DEBUG(), etc. - that cause a compile error if any argument is of fundamental type.

Friday, January 7, 2011

Pantheios::Extras::DiagUtil 0.1.1 (alpha 1)

I've just released the first publicly available version - 0.1.1 (alpha 1) - of Pantheios.Extras.DiagUtil; details here.

It allows a user to replace code such as:

 #if defined(_MSC_VER) && \
 # include <crtdbg.h>

 int main(int argc, char** argv)
 #if defined(_MSC_VER) && \
  _CrtMemState  memState;


  int result;

  . . .  // main program logic (which must assign to result)

 #if defined(_MSC_VER) && \


  return result;


 #include <pantheios/extras/diagutil.hpp>

 int program(int argc, char** argv)
  . . . // main program logic

  return EXIT_SUCCESS;

 int main(int argc, char** argv)
  return pantheios::extras::diagutil::
           main_leak_trace::invoke(argc, argv, program);

or, if your program is written in C, with:

 #include <pantheios/extras/diagutil.h>

 int program(int argc, char** argv)
  . . . // main program logic

  return EXIT_SUCCESS;

 int main(int argc, char** argv)
  return pantheios_extras_diagutil_main_leak_trace_invoke(
           argc, argv, program);

The immediate advantate is clear: substantially improved transparency in your application code. There are three secondary advantages:
  • you do not need to explicitly conditionally include crtdbg.h
  • the library can be enhanced in the future to work with other compiler-extensions, without requiring any changes to your code
  • you do not have to avoid the use of return statements in your main program logic, and to remember to assign to result

More memory-tracing functionality will appear in forthcoming releases.