This repository was archived by the owner on Jun 30, 2025. It is now read-only.

Description
Currently the vmodule implementation is limited to GNU compilers as it uses a compiler specific extension for the VLOG_IS_ON() macro. This can be written using an inline lambda in Visual Studio 2015 and likely any compiler with C++11 support. It may also make sense to replace the current GNU specific implementation with a common one based on a lambda if the compiler supports it.
Here's an implementation that works with Visual Studio 2015 from vlog_is_on.h.
#define VLOG_IS_ON(verboselevel) \
[]() \
{ \
static google::int32* vlocal__ = &google::kLogSiteUninitialized; \
google::int32 verbose_level__ = (verboselevel); \
return (*vlocal__ >= verbose_level__) && \
((vlocal__ != &google::kLogSiteUninitialized) || \
(google::InitVLOG3__(&vlocal__, &FLAGS_v, \
__FILE__, verbose_level__))); \
}()