Home

Glog

Glog, short for Google logging, is a C++ logging library developed by Google. It provides multi-level, configurable logging for C++ programs and is widely used in both Google code and open-source projects. The library defines logging macros such as LOG(INFO), LOG(WARNING), LOG(ERROR), and LOG(FATAL) for standard messages, as well as VLOG(n) for verbose logging. A FATAL log prints the message and terminates the program, while INFO and WARNING messages are written to logs or standard error depending on configuration.

Initialization is done with google::InitGoogleLogging(argv[0]); and the behavior is controlled at runtime through a set of

Glog is cross-platform and designed for integration into larger C++ projects. It is distributed as open-source

In typical usage, glog complements other Google-style tooling, such as gflags for command-line flags, and is

command-line
flags
(often
used
in
conjunction
with
the
gflags
library)
to
determine
output
destinations
and
verbosity.
Common
flags
include
--logtostderr
to
write
logs
to
standard
error,
--log_dir
to
specify
a
log
file
directory,
--minloglevel
to
set
the
minimum
severity,
and
--vmodule
to
adjust
verbose
levels
per
module.
Globs
of
the
library
also
support
failure
signal
handlers
and
log
rotation
in
its
log
files.
software
and
is
hosted
on
platforms
such
as
GitHub
under
the
google/glog
repository.
The
project
is
released
under
a
permissive
license,
making
it
suitable
for
use
in
a
range
of
open-source
and
proprietary
environments.
employed
to
provide
structured,
severity-based
logging
that
aids
debugging
and
monitoring
in
complex
C++
applications.