C++ implementation of the Google logging module

Related tags

Logging glog
Overview

Google Logging Library

Build Status Grunt status

The Google Logging Library (glog) implements application-level logging. The library provides logging APIs based on C++-style streams and various helper macros.

Getting Started

You can log a message by simply streaming things to LOG(<a particular severity level>), e.g.,

#include <glog/logging.h>

int main(int argc, char* argv[]) {
    // Initialize Google’s logging library.
    google::InitGoogleLogging(argv[0]);

    // ...
    LOG(INFO) << "Found " << num_cookies << " cookies";
}

For a detailed overview of glog features and their usage, please refer to the user guide.

Building from Source

glog supports multiple build systems for compiling the project from source: Bazel, CMake, and vcpkg.

Bazel

To use glog within a project which uses the Bazel build tool, add the following lines to your WORKSPACE file:

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
    name = "com_github_gflags_gflags",
    sha256 = "34af2f15cf7367513b352bdcd2493ab14ce43692d2dcd9dfc499492966c64dcf",
    strip_prefix = "gflags-2.2.2",
    urls = ["https://github.com/gflags/gflags/archive/v2.2.2.tar.gz"],
)

http_archive(
    name = "com_github_google_glog",
    sha256 = "62efeb57ff70db9ea2129a16d0f908941e355d09d6d83c9f7b18557c0a7ab59e",
    strip_prefix = "glog-d516278b1cd33cd148e8989aec488b6049a4ca0b",
    urls = ["https://github.com/google/glog/archive/d516278b1cd33cd148e8989aec488b6049a4ca0b.zip"],
)

You can then add @com_github_google_glog//:glog to the deps section of a cc_binary or cc_library rule, and #include <glog/logging.h> to include it in your source code. Here’s a simple example:

cc_binary(
    name = "main",
    srcs = ["main.cc"],
    deps = ["@com_github_google_glog//:glog"],
)

CMake

glog also supports CMake that can be used to build the project on a wide range of platforms. If you don’t have CMake installed already, you can download it for from CMake’s official website.

CMake works by generating native makefiles or build projects that can be used in the compiler environment of your choice. You can either build glog with CMake as a standalone project or it can be incorporated into an existing CMake build for another project.

Building glog with CMake

When building glog as a standalone project, on Unix-like systems with GNU Make as build tool, the typical workflow is:

  1. Get the source code and change to it. e.g., cloning with git:
git clone [email protected]:google/glog.git
cd glog
  1. Run CMake to configure the build tree.
cmake -H. -Bbuild -G "Unix Makefiles"

Note: to get the list of available generators (e.g., Visual Studio), use -G ""

  1. Afterwards, generated files can be used to compile the project.
cmake --build build
  1. Test the build software (optional).
cmake --build build --target test
  1. Install the built files (optional).
cmake --build build --target install

Consuming glog in a CMake Project

If you have glog installed in your system, you can use the CMake command find_package to build against glog in your CMake Project as follows:

cmake_minimum_required (VERSION 3.0.2)
project (myproj VERSION 1.0)

find_package (glog 0.5.0 REQUIRED)

add_executable (myapp main.cpp)
target_link_libraries (myapp glog::glog)

Compile definitions and options will be added automatically to your target as needed.

Incorporating glog into a CMake Project

You can also use the CMake command add_subdirectory to include glog directly from a subdirectory of your project by replacing the find_package call from the previous example by add_subdirectory. The glog::glog target is in this case an ALIAS library target for the glog library target.

Again, compile definitions and options will be added automatically to your target as needed.

vcpkg

The url of vcpkg is: https://github.com/Microsoft/vcpkg You can download and install glog using the vcpkg dependency manager:

git clone https://github.com/Microsoft/vcpkg.git
cd vcpkg
./bootstrap-vcpkg.sh
./vcpkg integrate install
./vcpkg install glog

The glog port in vcpkg is kept up to date by Microsoft team members and community contributors. If the version is out of date, please create an issue or pull request on the vcpkg repository.

User Guide

glog defines a series of macros that simplify many common logging tasks. You can log messages by severity level, control logging behavior from the command line, log based on conditionals, abort the program when expected conditions are not met, introduce your own verbose logging levels, and more.

Following sections describe the functionality supported by glog. Please note this description may not be complete but limited to the most useful ones. If you want to find less common features, please check header files under src/glog directory.

Severity Levels

You can specify one of the following severity levels (in increasing order of severity): INFO, WARNING, ERROR, and FATAL. Logging a FATAL message terminates the program (after the message is logged). Note that messages of a given severity are logged not only in the logfile for that severity, but also in all logfiles of lower severity. E.g., a message of severity FATAL will be logged to the logfiles of severity FATAL, ERROR, WARNING, and INFO.

The DFATAL severity logs a FATAL error in debug mode (i.e., there is no NDEBUG macro defined), but avoids halting the program in production by automatically reducing the severity to ERROR.

Unless otherwise specified, glog writes to the filename /tmp/\<program name\>.\<hostname\>.\<user name\>.log.\<severity level\>.\<date\>.\<time\>.\<pid\> (e.g., /tmp/hello_world.example.com.hamaji.log.INFO.20080709-222411.10474). By default, glog copies the log messages of severity level ERROR or FATAL to standard error (stderr) in addition to log files.

Setting Flags

Several flags influence glog’s output behavior. If the Google gflags library is installed on your machine, the configure script (see the INSTALL file in the package for detail of this script) will automatically detect and use it, allowing you to pass flags on the command line. For example, if you want to turn the flag --logtostderr on, you can start your application with the following command line:

./your_application --logtostderr=1

If the Google gflags library isn’t installed, you set flags via environment variables, prefixing the flag name with GLOG_, e.g.,

GLOG_logtostderr=1 ./your_application

The following flags are most commonly used:

logtostderr (bool, default=false)
Log messages to stderr instead of logfiles. Note: you can set binary flags to true by specifying 1, true, or yes (case insensitive). Also, you can set binary flags to false by specifying 0, false, or no (again, case insensitive).
stderrthreshold (int, default=2, which is ERROR)
Copy log messages at or above this level to stderr in addition to logfiles. The numbers of severity levels INFO, WARNING, ERROR, and FATAL are 0, 1, 2, and 3, respectively.
minloglevel (int, default=0, which is INFO)
Log messages at or above this level. Again, the numbers of severity levels INFO, WARNING, ERROR, and FATAL are 0, 1, 2, and 3, respectively.
log_dir (string, default="")
If specified, logfiles are written into this directory instead of the default logging directory.
v (int, default=0)
Show all VLOG(m) messages for m less or equal the value of this flag. Overridable by --vmodule. See the section about verbose logging for more detail.
vmodule (string, default="")
Per-module verbose level. The argument has to contain a comma-separated list of <module name>=<log level>. <module name> is a glob pattern (e.g., gfs* for all modules whose name starts with "gfs"), matched against the filename base (that is, name ignoring .cc/.h./-inl.h). <log level> overrides any value given by --v. See also the section about verbose logging.

There are some other flags defined in logging.cc. Please grep the source code for DEFINE_ to see a complete list of all flags.

You can also modify flag values in your program by modifying global variables FLAGS_* . Most settings start working immediately after you update FLAGS_* . The exceptions are the flags related to destination files. For example, you might want to set FLAGS_log_dir before calling google::InitGoogleLogging . Here is an example:

LOG(INFO) << "file";
// Most flags work immediately after updating values.
FLAGS_logtostderr = 1;
LOG(INFO) << "stderr";
FLAGS_logtostderr = 0;
// This won’t change the log destination. If you want to set this
// value, you should do this before google::InitGoogleLogging .
FLAGS_log_dir = "/some/log/directory";
LOG(INFO) << "the same file";

Conditional / Occasional Logging

Sometimes, you may only want to log a message under certain conditions. You can use the following macros to perform conditional logging:

LOG_IF(INFO, num_cookies > 10) << "Got lots of cookies";

The "Got lots of cookies" message is logged only when the variable num_cookies exceeds 10. If a line of code is executed many times, it may be useful to only log a message at certain intervals. This kind of logging is most useful for informational messages.

LOG_EVERY_N(INFO, 10) << "Got the " << google::COUNTER << "th cookie";

The above line outputs a log messages on the 1st, 11th, 21st, ... times it is executed. Note that the special google::COUNTER value is used to identify which repetition is happening.

You can combine conditional and occasional logging with the following macro.

LOG_IF_EVERY_N(INFO, (size > 1024), 10) << "Got the " << google::COUNTER
                                        << "th big cookie";

Instead of outputting a message every nth time, you can also limit the output to the first n occurrences:

LOG_FIRST_N(INFO, 20) << "Got the " << google::COUNTER << "th cookie";

Outputs log messages for the first 20 times it is executed. Again, the google::COUNTER identifier indicates which repetition is happening.

Debug Mode Support

Special "debug mode" logging macros only have an effect in debug mode and are compiled away to nothing for non-debug mode compiles. Use these macros to avoid slowing down your production application due to excessive logging.

DLOG(INFO) << "Found cookies";
DLOG_IF(INFO, num_cookies > 10) << "Got lots of cookies";
DLOG_EVERY_N(INFO, 10) << "Got the " << google::COUNTER << "th cookie";

CHECK Macros

It is a good practice to check expected conditions in your program frequently to detect errors as early as possible. The CHECK macro provides the ability to abort the application when a condition is not met, similar to the assert macro defined in the standard C library.

CHECK aborts the application if a condition is not true. Unlike assert, it is *not* controlled by NDEBUG, so the check will be executed regardless of compilation mode. Therefore, fp->Write(x) in the following example is always executed:

CHECK(fp->Write(x) == 4) << "Write failed!";

There are various helper macros for equality/inequality checks - CHECK_EQ, CHECK_NE, CHECK_LE, CHECK_LT, CHECK_GE, and CHECK_GT. They compare two values, and log a FATAL message including the two values when the result is not as expected. The values must have operator<<(ostream, ...) defined.

You may append to the error message like so:

CHECK_NE(1, 2) << ": The world must be ending!";

We are very careful to ensure that each argument is evaluated exactly once, and that anything which is legal to pass as a function argument is legal here. In particular, the arguments may be temporary expressions which will end up being destroyed at the end of the apparent statement, for example:

CHECK_EQ(string("abc")[1], ’b’);

The compiler reports an error if one of the arguments is a pointer and the other is NULL. To work around this, simply static_cast NULL to the type of the desired pointer.

CHECK_EQ(some_ptr, static_cast<SomeType*>(NULL));

Better yet, use the CHECK_NOTNULL macro:

CHECK_NOTNULL(some_ptr);
some_ptr->DoSomething();

Since this macro returns the given pointer, this is very useful in constructor initializer lists.

struct S {
    S(Something* ptr) : ptr_(CHECK_NOTNULL(ptr)) {}
    Something* ptr_;
};

Note that you cannot use this macro as a C++ stream due to this feature. Please use CHECK_EQ described above to log a custom message before aborting the application.

If you are comparing C strings (char *), a handy set of macros performs case sensitive as well as case insensitive comparisons - CHECK_STREQ, CHECK_STRNE, CHECK_STRCASEEQ, and CHECK_STRCASENE. The CASE versions are case-insensitive. You can safely pass NULL pointers for this macro. They treat NULL and any non-NULL string as not equal. Two NULLs are equal.

Note that both arguments may be temporary strings which are destructed at the end of the current "full expression" (e.g., CHECK_STREQ(Foo().c_str(), Bar().c_str()) where Foo and Bar return C++’s std::string).

The CHECK_DOUBLE_EQ macro checks the equality of two floating point values, accepting a small error margin. CHECK_NEAR accepts a third floating point argument, which specifies the acceptable error margin.

Verbose Logging

When you are chasing difficult bugs, thorough log messages are very useful. However, you may want to ignore too verbose messages in usual development. For such verbose logging, glog provides the VLOG macro, which allows you to define your own numeric logging levels. The --v command line option controls which verbose messages are logged:

VLOG(1) << "I’m printed when you run the program with --v=1 or higher";
VLOG(2) << "I’m printed when you run the program with --v=2 or higher";

With VLOG, the lower the verbose level, the more likely messages are to be logged. For example, if --v==1, VLOG(1) will log, but VLOG(2) will not log. This is opposite of the severity level, where INFO is 0, and ERROR is 2. --minloglevel of 1 will log WARNING and above. Though you can specify any integers for both VLOG macro and --v flag, the common values for them are small positive integers. For example, if you write VLOG(0), you should specify --v=-1 or lower to silence it. This is less useful since we may not want verbose logs by default in most cases. The VLOG macros always log at the INFO log level (when they log at all).

Verbose logging can be controlled from the command line on a per-module basis:

--vmodule=mapreduce=2,file=1,gfs*=3 --v=0

will:

  1. Print VLOG(2) and lower messages from mapreduce.{h,cc}
  2. Print VLOG(1) and lower messages from file.{h,cc}
  3. Print VLOG(3) and lower messages from files prefixed with "gfs"
  4. Print VLOG(0) and lower messages from elsewhere

The wildcarding functionality shown by (c) supports both ’*’ (matches 0 or more characters) and ’?’ (matches any single character) wildcards. Please also check the section about command line flags.

There’s also VLOG_IS_ON(n) "verbose level" condition macro. This macro returns true when the --v is equal or greater than n. To be used as

if (VLOG_IS_ON(2)) {
    // do some logging preparation and logging
    // that can’t be accomplished with just VLOG(2) << ...;
}

Verbose level condition macros VLOG_IF, VLOG_EVERY_N and VLOG_IF_EVERY_N behave analogous to LOG_IF, LOG_EVERY_N, LOF_IF_EVERY, but accept a numeric verbosity level as opposed to a severity level.

VLOG_IF(1, (size > 1024))
   << "I’m printed when size is more than 1024 and when you run the "
      "program with --v=1 or more";
VLOG_EVERY_N(1, 10)
   << "I’m printed every 10th occurrence, and when you run the program "
      "with --v=1 or more. Present occurence is " << google::COUNTER;
VLOG_IF_EVERY_N(1, (size > 1024), 10)
   << "I’m printed on every 10th occurence of case when size is more "
      " than 1024, when you run the program with --v=1 or more. ";
      "Present occurence is " << google::COUNTER;

Failure Signal Handler

The library provides a convenient signal handler that will dump useful information when the program crashes on certain signals such as SIGSEGV. The signal handler can be installed by google::InstallFailureSignalHandler(). The following is an example of output from the signal handler.

*** Aborted at 1225095260 (unix time) try "date -d @1225095260" if you are using GNU date ***
*** SIGSEGV (@0x0) received by PID 17711 (TID 0x7f893090a6f0) from PID 0; stack trace: ***
PC: @           0x412eb1 TestWaitingLogSink::send()
    @     0x7f892fb417d0 (unknown)
    @           0x412eb1 TestWaitingLogSink::send()
    @     0x7f89304f7f06 google::LogMessage::SendToLog()
    @     0x7f89304f35af google::LogMessage::Flush()
    @     0x7f89304f3739 google::LogMessage::~LogMessage()
    @           0x408cf4 TestLogSinkWaitTillSent()
    @           0x4115de main
    @     0x7f892f7ef1c4 (unknown)
    @           0x4046f9 (unknown)

By default, the signal handler writes the failure dump to the standard error. You can customize the destination by InstallFailureWriter().

Performance of Messages

The conditional logging macros provided by glog (e.g., CHECK, LOG_IF, VLOG, ...) are carefully implemented and don’t execute the right hand side expressions when the conditions are false. So, the following check may not sacrifice the performance of your application.

CHECK(obj.ok) << obj.CreatePrettyFormattedStringButVerySlow();

User-defined Failure Function

FATAL severity level messages or unsatisfied CHECK condition terminate your program. You can change the behavior of the termination by InstallFailureFunction.

void YourFailureFunction() {
  // Reports something...
  exit(1);
}

int main(int argc, char* argv[]) {
  google::InstallFailureFunction(&YourFailureFunction);
}

By default, glog tries to dump stacktrace and makes the program exit with status 1. The stacktrace is produced only when you run the program on an architecture for which glog supports stack tracing (as of September 2008, glog supports stack tracing for x86 and x86_64).

Raw Logging

The header file <glog/raw_logging.h> can be used for thread-safe logging, which does not allocate any memory or acquire any locks. Therefore, the macros defined in this header file can be used by low-level memory allocation and synchronization code. Please check src/glog/raw_logging.h.in for detail.

Google Style perror()

PLOG() and PLOG_IF() and PCHECK() behave exactly like their LOG* and CHECK equivalents with the addition that they append a description of the current state of errno to their output lines. E.g.

PCHECK(write(1, NULL, 2) >= 0) << "Write NULL failed";

This check fails with the following error message.

F0825 185142 test.cc:22] Check failed: write(1, NULL, 2) >= 0 Write NULL failed: Bad address [14]

Syslog

SYSLOG, SYSLOG_IF, and SYSLOG_EVERY_N macros are available. These log to syslog in addition to the normal logs. Be aware that logging to syslog can drastically impact performance, especially if syslog is configured for remote logging! Make sure you understand the implications of outputting to syslog before you use these macros. In general, it’s wise to use these macros sparingly.

Strip Logging Messages

Strings used in log messages can increase the size of your binary and present a privacy concern. You can therefore instruct glog to remove all strings which fall below a certain severity level by using the GOOGLE_STRIP_LOG macro:

If your application has code like this:

#define GOOGLE_STRIP_LOG 1    // this must go before the #include!
#include <glog/logging.h>

The compiler will remove the log messages whose severities are less than the specified integer value. Since VLOG logs at the severity level INFO (numeric value 0), setting GOOGLE_STRIP_LOG to 1 or greater removes all log messages associated with VLOGs as well as INFO log statements.

Automatically Remove Old Logs

To enable the log cleaner:

google::EnableLogCleaner(3); // keep your logs for 3 days

And then glog will check if there are overdue logs whenever a flush is performed. In this example, any log file from your project whose last modified time is greater than 3 days will be unlink()ed.

This feature can be disabled at any time (if it has been enabled)

google::DisableLogCleaner();

Notes for Windows Users

glog defines a severity level ERROR, which is also defined in windows.h . You can make glog not define INFO, WARNING, ERROR, and FATAL by defining GLOG_NO_ABBREVIATED_SEVERITIES before including glog/logging.h . Even with this macro, you can still use the iostream like logging facilities:

#define GLOG_NO_ABBREVIATED_SEVERITIES
#include <windows.h>
#include <glog/logging.h>

// ...

LOG(ERROR) << "This should work";
LOG_IF(ERROR, x > y) << "This should be also OK";

However, you cannot use INFO, WARNING, ERROR, and FATAL anymore for functions defined in glog/logging.h .

#define GLOG_NO_ABBREVIATED_SEVERITIES
#include <windows.h>
#include <glog/logging.h>

// ...

// This won’t work.
// google::FlushLogFiles(google::ERROR);

// Use this instead.
google::FlushLogFiles(google::GLOG_ERROR);

If you don’t need ERROR defined by windows.h, there are a couple of more workarounds which sometimes don’t work:

  • #define WIN32_LEAN_AND_MEAN or NOGDI before you #include windows.h.
  • #undef ERROR after you #include windows.h .

See this issue for more detail.

Installation Notes for 64-bit Linux Systems

The glibc built-in stack-unwinder on 64-bit systems has some problems with glog. (In particular, if you are using InstallFailureSignalHandler(), the signal may be raised in the middle of malloc, holding some malloc-related locks when they invoke the stack unwinder. The built-in stack unwinder may call malloc recursively, which may require the thread to acquire a lock it already holds: deadlock.)

For that reason, if you use a 64-bit system and you need InstallFailureSignalHandler(), we strongly recommend you install libunwind before trying to configure or install google glog. libunwind can be found here.

Even if you already have libunwind installed, you will probably still need to install from the snapshot to get the latest version.

Caution: if you install libunwind from the URL above, be aware that you may have trouble if you try to statically link your binary with glog: that is, if you link with gcc -static -lgcc_eh .... This is because both libunwind and libgcc implement the same C++ exception handling APIs, but they implement them differently on some platforms. This is not likely to be a problem on ia64, but may be on x86-64.

Also, if you link binaries statically, make sure that you add -Wl,--eh-frame-hdr to your linker options. This is required so that libunwind can find the information generated by the compiler required for stack unwinding.

Using -static is rare, though, so unless you know this will affect you it probably won’t.

If you cannot or do not wish to install libunwind, you can still try to use two kinds of stack-unwinder: 1. glibc built-in stack-unwinder and 2. frame pointer based stack-unwinder.

  1. As we already mentioned, glibc’s unwinder has a deadlock issue. However, if you don’t use InstallFailureSignalHandler() or you don’t worry about the rare possibilities of deadlocks, you can use this stack-unwinder. If you specify no options and libunwind isn’t detected on your system, the configure script chooses this unwinder by default.
  2. The frame pointer based stack unwinder requires that your application, the glog library, and system libraries like libc, all be compiled with a frame pointer. This is not the default for x86-64.

How to Contribute

We’d love to accept your patches and contributions to this project. There are a just a few small guidelines you need to follow.

Contributor License Agreement (CLA)

Contributions to any Google project must be accompanied by a Contributor License Agreement. This is not a copyright assignment, it simply gives Google permission to use and redistribute your contributions as part of the project.

  • If you are an individual writing original source code and you’re sure you own the intellectual property, then you’ll need to sign an individual CLA.
  • If you work for a company that wants to allow you to contribute your work, then you’ll need to sign a corporate CLA.

You generally only need to submit a CLA once, so if you’ve already submitted one (even if it was for a different project), you probably don’t need to do it again.

Once your CLA is submitted (or if you already submitted one for another Google project), make a commit adding yourself to the AUTHORS and CONTRIBUTORS files. This commit can be part of your first pull request.

Submitting a Patch

  1. It’s generally best to start by opening a new issue describing the bug or feature you’re intending to fix. Even if you think it’s relatively minor, it’s helpful to know what people are working on. Mention in the initial issue that you are planning to work on that bug or feature so that it can be assigned to you.
  2. Follow the normal process of forking the project, and setup a new branch to work in. It’s important that each group of changes be done in separate branches in order to ensure that a pull request only includes the commits related to that bug or feature.
  3. Do your best to have well-formed commit messages for each change. This provides consistency throughout the project, and ensures that commit messages are able to be formatted properly by various git tools.
  4. Finally, push the commits to your fork and submit a pull request.
Comments
  • Add CMake support for glog

    Add CMake support for glog

    Hi

    would it be possible to add cmake support for Glog ? Gflags already support cmake, it would be consistent to have glog supporting it also. It seems that there have been attempts to do that in the past.

    Thanks you very much in advance

    enhancement 
    opened by prudhomm 35
  • ./configure && make && make install fails with error: expected initializer before 'Demangle'

    ./configure && make && make install fails with error: expected initializer before 'Demangle'

    The error is below. I see the same problem referenced in https://github.com/google/glog/pull/7, though it's not clear to me from the discussion whether this issue is fixed, and the instructions still direct users to use ./configure && make && make install.

    libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I./src -I./src -Wall -Wwrite-strings -Woverloaded-virtual -Wno-sign-compare -DNO_FRAME_POINTER -DNDEBUG -g -O2 -MT src/libglog_la-demangle.lo -MD -MP -MF src/.deps/libglog_la-demangle.Tpo -c src/demangle.cc  -fPIC -DPIC -o src/.libs/libglog_la-demangle.o
    In file included from src/demangle.cc:38:0:
    src/demangle.h:80:27: error: expected initializer before 'Demangle'
     bool GOOGLE_GLOG_DLL_DECL Demangle(const char *mangled, char *out, int out_size);
                               ^
    
    opened by rgiordan 25
  • autoconf build does not version the library

    autoconf build does not version the library

    ./configure; make install and cmake ..; make install produce different libraries

    The cmake version doesn't create this missing library/symlink:

      /usr/local/opt/glog/lib/libglog.0.dylib
    

    discovered in: https://github.com/Homebrew/homebrew-core/pull/14379

    bug PR welcome 
    opened by ahundt 21
  • Add support for deleting old logs

    Add support for deleting old logs

    Hi, Can we add a support for deleting old logs? As of now, log just keeps accumulating until it takes entire disk space. If we set the max log size to 10MB, glog keeps generating 10MB log files never deleting. I'd like to keep only latest 4 logs (of 10MB or smaller).

    I know there are tools which can be run to do the cleanup such as logrotate. We make Windows DLL which runs on embedded machine made by another company. We don't have control on this embedded machine, so we cannot run any program to rotate the log.

    I've added RotateLogFile function which checks for number of log files and deletes old logs. RotateLogFile is run in LogFileObject::Write as it log is rolled over and new log file is created (when max_log_size is reached).

    so if we have following 4 logs,

    log_20150617-141944.8600 log_20150618-166949.8600 log_20150619-119953.8600 log_20150620-107957.8600

    And if a new one is created, the oldest one is deleted leaving 4 logs log_20150617-141944.8600 <-Deleted log_20150618-163949.8600 log_20150619-112953.8600 log_20150620-101957.8600 log_20150621-103957.8600 <-- Created

    Has this feature been considered before? Can you add this?

    Thanks,

    Isao

    enhancement PR welcome 
    opened by isaoa 21
  • Add support for customizing the prefix format

    Add support for customizing the prefix format

    This PR proposes a way of adding support to customize the prefix format used by glog.

    With it users can declare a callback (PrefixAttacherFunction(std::ostream&, const LogMessageInfo&)) that will receive the relevant log details for the line and a stream to write a corresponding prefix.

    That callback is enabled by passing it to a new overloaded InitGoogleLogging(). (The callback cannot be changed once the instance is initialized.)

    If no callback is specified, LogMessage will follow the same path as it does now and write the current hardcoded format.

    For an example use case, see the unit tests insrc/logging_custom_prefix_unittest.cc.

    enhancement cla: yes 
    opened by santigl 15
  • import of module 'glog.glog.log_severity' appears within namespace 'google'

    import of module 'glog.glog.log_severity' appears within namespace 'google'

    Hello All, I am running iOS project using react-native. I have installed pods, below is my Podfile

    _source 'https://github.com/CocoaPods/Specs.git' source 'https://github.com/goinstant/pods-specs-public'

    target ‘appName’ do platform :ios, '9.0' use_modular_headers!

    pod 'GoogleSignIn'
    pod 'GoogleMaps'    
    
    pod 'React', :path => './node_modules/react-native', :subspecs => [
    'Core',
    'RCTText',
    'RCTImage',
    'RCTNetwork',
    'CxxBridge',
    'RCTLinkingIOS',
    'RCTWebSocket',
    'RCTAnimation',
    'DevSupport',
    pod 'yoga', :path => './node_modules/react-native/ReactCommon/yoga'
    post_install do |installer|
        installer.pods_project.targets.each do |target|
            phase_name = 'Headers'
            target.build_configurations.each do |config|
                config.build_settings['SWIFT_VERSION'] = '3.0'
            end
        end
    end
    pod 'ReactNativeLocalization", :path => './node_modules/react-native-localization'
    pod 'BVLinearGradient', :path => './node_modules/react-native-linear-gradient'
    pod 'DoubleConversion', :podspec => './node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
    pod 'glog', :podspec => './node_modules/react-native/third-party-podspecs/glog.podspec'
    pod 'Folly', :podspec => './node_modules/react-native/third-party-podspecs/Folly.podspec'
    

    end_

    So when I run my project, I get the above error. Please let me know how to fix this.

    invalid incomplete 
    opened by imRanjit 15
  • Port stack tracing to Windows

    Port stack tracing to Windows

    This set of patches implements the stack trace, symbolizer, and demangler for Windows, and their unit tests. It utilizes the Windows debugging APIs in "Dbghelp.h".

    There is one TODO for IsFailureSignalHandlerInstalled as I'm unsure yet how to implement it for Windows. That said, in order to make stack trace reporting work "as expected" for test failures, the data dump needs to be done immediately, instead of in the signal handler (see commit message for details).

    I've integration tested this with Mesos, and so far it is working well. I've also updated the unit tests where appropriate.

    cla: yes 
    opened by andschwa 15
  • CMake support

    CMake support

    This series of patches adds CMake support to glog and fixes several compilation issues.

    My primary goal was to be able to compile glog on Windows using Visual Studio without any hassle. The modifications have been tested using VC 8.0 through VC 14.0 CTP 6, cygwin gcc 4.9.2, Intel C++ Compiler 15.0, Apple Clang, and on Arch Linux using gcc 4.9.2 and clang 3.6 (both static and shared builds).

    CMakeLists.txt also generates config files, which allow to use glog in CMake projects easily:

    cmake_minimum_required (VERSION 2.8.11)
    project (myproject)
    
    find_package (glog 0.3.4)
    
    add_executable (myproject myproject.cpp)
    target_link_libraries (myproject glog)
    

    To run the unit tests, execute:

    make test
    

    when using the Makefiles generator.

    cla: yes 
    opened by sergiud 15
  • rename `GOOGLE_GLOG_DLL_DECL` to `GLOG_EXPORT`

    rename `GOOGLE_GLOG_DLL_DECL` to `GLOG_EXPORT`

    Use a consistent naming and avoid platform specific terms. Also remove copy and paste code.

    @drigz Is there a way to define GLOG_EXPORT=__declspec(dllimport) for Windows builds only when glog is being used (as opposed to being compiled)?

    enhancement 
    opened by sergiud 14
  • Bazel support for windows

    Bazel support for windows

    Using google/glog from a bazel project on windows doesn't work. bazel/glog.bzl doesn't seem to be windows compatible (but does on linux and darwing). Is there a plan to add support for it ?

    here is the error I get :

    $> bazel build --compiler=clang-cl --cxxopt=/std:c++17 @com_google_glog//:glog
    INFO: Writing tracer profile to 'C:/users/lucbe/_bazel_lucbe/ixjskkhv/command.profile.gz'
    INFO: Analyzed target @com_google_glog//:glog (0 packages loaded, 0 targets configured).
    INFO: Found 1 target...
    ERROR: C:/users/lucbe/_bazel_lucbe/ixjskkhv/external/com_google_glog/BUILD:5:1: C++ compilation of rule '@com_google_glog//:glog' failed (Exit 1)
    In file included from external/com_google_glog/src/demangle.cc:38:
    external/com_google_glog/src/utilities.h(80,11): fatal error: 'port.h' file not found
    # include "port.h"
              ^~~~~~~~
    1 error generated.
    Target @com_google_glog//:glog failed to build
    Use --verbose_failures to see the command lines of failed build steps.
    INFO: Elapsed time: 1.512s, Critical Path: 1.05s
    INFO: 0 processes.
    FAILED: Build did NOT complete successfully
    
    enhancement PR welcome 
    opened by skeptic-monkey 14
  • glog detected wrong gflags namespace.

    glog detected wrong gflags namespace.

    • Build System
      • Ubuntu 18.04
      • gcc 7.3.0
      • cmake 3.10.2
      • gflags 2.2.1
      • glog ~~0.3.5~~ 2faa186
    • I compile gflags with cmake -DBUILD_SHARED_LIBS=ON -DGFLAGS_NAMESPACE=google -DCMAKE_INSTALL_PREFIX=/opt/gflags -DCMAKE_CXX_FLAGS=-fPIC .. and sudo make -j2 && sudo make install
    • I write a gflags demo file, and it works.
    #include <iostream>
    #include <gflags/gflags.h>
    
    int main(int argc, char *argv[])
    {
      google::ParseCommandLineFlags(&argc, &argv, true);
    
      return EXIT_SUCCESS;
    }
    
    
    • compile it with g++ -Wall -Wextra -Werror -std=c++11 -Wl,-rpath=/opt/gflags/lib/ -o proc main.cc -L /opt/gflags/lib -lgflags, and it works fine.
    • However glog detected wrong gflags namespace when I compile it from source. I run cmake -DCMAKE_INSTALL_RPATH=/opt/gflags/lib -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX=/opt/glog -DCMAKE_BUILD_TYPE=RELEASE -DWITH_GFLAGS=ON -DCMAKE_CXX_FLAGS=-fPIC .., but it show that

    -- Looking for gflags namespace -- Looking for gflags namespace - gflags

    • Then I run cmake -L .., it shows gflags_DIR is detected correctly.

    gflags_DIR:PATH=/opt/gflags/lib/cmake/gflags

    • Then i write a glog demo
    #include <iostream>
    #include <glog/logging.h>
    
    int main(int , char *argv[])
    {
      google::InitGoogleLogging(argv[0]);
    
      LOG(INFO) << "Hello Glog!";
    
      return EXIT_SUCCESS;
    }
    
    • compile it with g++ -Wall -Wextra -Werror -std=c++11 -Wl,-rpath=/opt/glog/lib -o proc main.cc -L /opt/glog/lib -lglog
    • ./proc --logtostderr=1 doesn't work. It doesn't print message to stderr.
    • GLOG_logtostderr=1 ./proc works fine surely.
    • Thanks.
    opened by loop0day 13
  • Set different overduedays for different levels of logs

    Set different overduedays for different levels of logs

    At present, we can use EnableLogCleaner to enable logclean and set overduedays.

    but the overduedays of all level log is the same.

    I think we can add some variables and methods in logclean to support to set different overduedays for different levels of logs.

    we can also support to enable or disable each level individually.

    opened by IoCing 0
  • TID in the files and on the stack trace not matching

    TID in the files and on the stack trace not matching

    In the stack trace, we see something like this:

    *** SIGSEGV (@0x149d) received by PID 22298 (TID 0x36087700) from PID 5277; stack trace: ***
    

    In the files, we see: I1107 17:38:43.965498 22378 xx.cc:nnn]

    22378 is supposed to be the thread id and so is: 0x36087700. I skimmed over the code and seems like 2 different functions are used to compute the values:

    (a) https://github.com/google/glog/blob/a34226ca94be8faae363b0599e5c4cdb7767774a/src/signalhandler.cc#L211 (b) https://github.com/google/glog/blob/f4dd77ae6b8e5f8e1323c929e81dbc40ff58fc7b/src/utilities.cc#L259

    What is the relation between the two? How do I know which TID caused the crash?

    PR welcome 
    opened by amandeepgautam 5
  • Provide API for logging with per-thread counters

    Provide API for logging with per-thread counters

    This is an RFC for a feature to allow counting loggers to use thread-local variables.

    I'm writing task-based routines that spawn threads to repeatedly run a function or lambda. Currently only the thread that "wins" the shared count to N gets to log which is suboptimal for this use case.

    It would be nice to be able to periodically report progress from each thread with independent counters for each task's loop.

    If this is something we'd want to add, I'll follow up with docs and tests. Thanks for looking!

    opened by boscosiu 1
  • Some g++ symbols aren't demangled (.localalias & .cold)

    Some g++ symbols aren't demangled (.localalias & .cold)

    I linked glog 0.6.0 using this NixOS recipe (with gflags dependency removed) into my c++ application. I see a stack trace with some C++ symbols properly demangled while a few remain mangled (and good enough for c++filt to decode). E.g.

    
        @     0x7f051d8a618a _ZN4mlir6detail17OpToOpPassAdaptor3runEPNS_4PassEPNS_9OperationENS_15AnalysisManagerEbj.localalias
        @     0x7f051d8a6599 _ZN4mlir6detail17OpToOpPassAdaptor11runPipelineERNS_13OpPassManagerEPNS_9OperationENS_15AnalysisManagerEbjPNS_16PassInstrumentorEPKNS_19PassInstrumentation18PipelineParentInfoE.localalias
        @     0x7f051d8a54ef _ZN4mlir6detail17OpToOpPassAdaptor23runOnOperationAsyncImplEb.localalias
        @     0x7f051d8a5fd4 _ZN4mlir6detail17OpToOpPassAdaptor3runEPNS_4PassEPNS_9OperationENS_15AnalysisManagerEbj.localalias
        @     0x7f051d8a6599 _ZN4mlir6detail17OpToOpPassAdaptor11runPipelineERNS_13OpPassManagerEPNS_9OperationENS_15AnalysisManagerEbjPNS_16PassInstrumentorEPKNS_19PassInstrumentation18PipelineParentInfoE.localalias
        @     0x7f051d8a7420 mlir::PassManager::run()
        @           0x525cf8 main
        @     0x7f05088e2790 __libc_start_main
        @           0x5c3e7a _start
    

    which after c++filt become a pleasant to read

        @     0x7f051d8a618a mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) [clone .localalias]
        @     0x7f051d8a6599 mlir::detail::OpToOpPassAdaptor::runPipeline(mlir::OpPassManager&, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) [clone .localalias]
        @     0x7f051d8a54ef mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool) [clone .localalias]
        @     0x7f051d8a5fd4 mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) [clone .localalias]
        @     0x7f051d8a6599 mlir::detail::OpToOpPassAdaptor::runPipeline(mlir::OpPassManager&, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) [clone .localalias]
        @     0x7f051d8a7420 mlir::PassManager::run()
        @           0x525cf8 main
        @     0x7f05088e2790 __libc_start_main
        @           0x5c3e7a _start
    

    I activate the stack trace with google::InstallFailureSignalHandler(); no further flags or configuration.

    Is there some kind of limit on the length of mangled identifiers or some other option I'm missing?

    opened by blackgnezdo 3
Releases(v0.6.0)
  • v0.6.0(Apr 4, 2022)

    What's Changed

    • bazel: Use glog 0.5.0 in README by @drigz in https://github.com/google/glog/pull/647
    • Expose IsGoogleLoggingInitialized() in public API. by @xkszltl in https://github.com/google/glog/pull/651
    • Fix cmake configuration for cygwin environment by @romange in https://github.com/google/glog/pull/656
    • Allow updating vmodule levels after vmodule level has been cached by @romange in https://github.com/google/glog/pull/650
    • Export COPYING by @fmeum in https://github.com/google/glog/pull/666
    • cmake: fixed msvc snprintf detection (fixes #668) by @sergiud in https://github.com/google/glog/pull/670
    • cmake: allow to override -fPIC by @sergiud in https://github.com/google/glog/pull/672
    • cmake: export <atomic> availability (fixes #667) by @sergiud in https://github.com/google/glog/pull/671
    • Remove ubuntu1604 from presubmit.yml by @philwo in https://github.com/google/glog/pull/677
    • bazel: add GLOG_CUSTOM_PREFIX_SUPPORT by @luliyucoordinate in https://github.com/google/glog/pull/676
    • log messages periodically (time-based) by @darbitman in https://github.com/google/glog/pull/669
    • ci: support more targets by @sergiud in https://github.com/google/glog/pull/686
    • cmake: prefer linking against gflags::gflags (fixes #683) by @sergiud in https://github.com/google/glog/pull/684
    • Fix syscall deprecation warning on macOS >= 10.12 by @z-aki in https://github.com/google/glog/pull/685
    • fixed exception specification mismatch by @sergiud in https://github.com/google/glog/pull/687
    • readme: fix wrong header id by @StephLin in https://github.com/google/glog/pull/674
    • eliminate warnings by @sergiud in https://github.com/google/glog/pull/688
    • fixed additional warnings by @sergiud in https://github.com/google/glog/pull/694
    • Add an static cast to compare unsigned with unsigned by @Fettpet in https://github.com/google/glog/pull/696
    • Fix: not implement virtual class when WITH_CUSTOM_PREFIX on by @Starsss in https://github.com/google/glog/pull/700
    • Change size type in AnnotateBenignRaceSized to size_t from long by @dfreese in https://github.com/google/glog/pull/706
    • Fix link error for Emscripten by @kinsei0916 in https://github.com/google/glog/pull/710
    • raw_logging.h depends on type definition in logging.h. by @xkszltl in https://github.com/google/glog/pull/713
    • export OS_* defines (fixes #715) by @sergiud in https://github.com/google/glog/pull/716
    • Fix syscall warning in Bazel Build by @ArthurBandaryk in https://github.com/google/glog/pull/718
    • Add -Werror to Bazel presubmits by @drigz in https://github.com/google/glog/pull/719
    • added gmock support by @sergiud in https://github.com/google/glog/pull/720
    • Support stack unwind on Android by @huangqinjin in https://github.com/google/glog/pull/708
    • add linux github workflow by @sergiud in https://github.com/google/glog/pull/722
    • ci: replace generated headers by templates by @sergiud in https://github.com/google/glog/pull/723
    • add mock log test by @sergiud in https://github.com/google/glog/pull/724
    • added log cleaner tests and fixed paths by @sergiud in https://github.com/google/glog/pull/732
    • Make LogCleaner support relative paths by @aesophor in https://github.com/google/glog/pull/654
    • cmake: Fix incorrect relative-path concatenation by @nh2 in https://github.com/google/glog/pull/733
    • Restore the stream format after writing the log prefix by @meyerj in https://github.com/google/glog/pull/731
    • fix glog-modules.cmake install by @sergiud in https://github.com/google/glog/pull/739
    • protect VLOG by use_logging by @sergiud in https://github.com/google/glog/pull/742
    • Fix log filename format by @cmsflash in https://github.com/google/glog/pull/747
    • Add Zhuoran Shen to AUTHORS and CONTRIBUTORS by @cmsflash in https://github.com/google/glog/pull/748
    • ci: reworked windows builds by @sergiud in https://github.com/google/glog/pull/737
    • cmake: set CMP0074 policy by @sergiud in https://github.com/google/glog/pull/751
    • ci: use codecov token by @sergiud in https://github.com/google/glog/pull/752
    • Added gmtoff() method in 'LogMessageTime' to get GMT offset by @vijaysattigeri in https://github.com/google/glog/pull/727
    • LogCleaner: Fix relative paths and add a new test by @aesophor in https://github.com/google/glog/pull/754
    • eliminate msvc warnings by @sergiud in https://github.com/google/glog/pull/757
    • cmake: require at least version 3.16 by @sergiud in https://github.com/google/glog/pull/758
    • ci: enable warnings as errors by @sergiud in https://github.com/google/glog/pull/759
    • LogCleaner: make overdue_days_ unsigned int by @aesophor in https://github.com/google/glog/pull/760
    • ci: remove deprecated msvc runner by @sergiud in https://github.com/google/glog/pull/762
    • provide backward compatible send overload by @sergiud in https://github.com/google/glog/pull/763
    • run clang-tidy by @sergiud in https://github.com/google/glog/pull/765
    • eliminate clang warnings by @sergiud in https://github.com/google/glog/pull/766
    • ensure _Unwind_Backtrace to actually be available by @sergiud in https://github.com/google/glog/pull/767
    • cmake: do not search for platform specific unwind by @sergiud in https://github.com/google/glog/pull/769
    • revert to signed int atomics by @sergiud in https://github.com/google/glog/pull/770
    • Add the "FLAG_log_year_in_prefix" by @msamoila in https://github.com/google/glog/pull/771
    • use uint32 for --max-log-size by @sergiud in https://github.com/google/glog/pull/773
    • stdcxx: eliminate excessive use of std::string::c_str() by @anpol in https://github.com/google/glog/pull/775
    • cmake: require at least gflags 2.2.2 by @sergiud in https://github.com/google/glog/pull/781
    • Changed my Email ID by @vijaysattigeri in https://github.com/google/glog/pull/782
    • On Solaris, GetHostName() returns empty string by @fkolarek in https://github.com/google/glog/pull/783
    • LogCleaner: avoid scanning logs too frequently by @fdgkhdkgh in https://github.com/google/glog/pull/776
    • libglog.pc: Set Libs.private for static linking by @Arfrever in https://github.com/google/glog/pull/787
    • cmake: enable custom prefix by default by @sergiud in https://github.com/google/glog/pull/788
    • simplify flags export by @sergiud in https://github.com/google/glog/pull/791
    • rename GOOGLE_GLOG_DLL_DECL to GLOG_EXPORT by @sergiud in https://github.com/google/glog/pull/764
    • cmake_package_config_generate: Fix CMake warnings with CMake 3.23 by @Arfrever in https://github.com/google/glog/pull/792
    • Tests: Respect TEST_TMPDIR, TMPDIR, TMP environmental variables by @Arfrever in https://github.com/google/glog/pull/794
    • Add the logtostdout and colorlogtostdout flag to allow logging to stdout by @git-hulk in https://github.com/google/glog/pull/790
    • Add clang-cl.exe to Bazel CI by @drigz in https://github.com/google/glog/pull/802
    • Fix "'GLOG_EXPORT' macro redefined" on clang-cl by @drigz in https://github.com/google/glog/pull/803
    • Fix namespace resolution issue in LOG_EVERY_T by @skeptic-monkey in https://github.com/google/glog/pull/801
    • release 0.6 by @sergiud in https://github.com/google/glog/pull/812

    New Contributors

    • @xkszltl made their first contribution in https://github.com/google/glog/pull/651
    • @fmeum made their first contribution in https://github.com/google/glog/pull/666
    • @luliyucoordinate made their first contribution in https://github.com/google/glog/pull/676
    • @darbitman made their first contribution in https://github.com/google/glog/pull/669
    • @z-aki made their first contribution in https://github.com/google/glog/pull/685
    • @StephLin made their first contribution in https://github.com/google/glog/pull/674
    • @Fettpet made their first contribution in https://github.com/google/glog/pull/696
    • @Starsss made their first contribution in https://github.com/google/glog/pull/700
    • @dfreese made their first contribution in https://github.com/google/glog/pull/706
    • @kinsei0916 made their first contribution in https://github.com/google/glog/pull/710
    • @ArthurBandaryk made their first contribution in https://github.com/google/glog/pull/718
    • @nh2 made their first contribution in https://github.com/google/glog/pull/733
    • @meyerj made their first contribution in https://github.com/google/glog/pull/731
    • @cmsflash made their first contribution in https://github.com/google/glog/pull/747
    • @vijaysattigeri made their first contribution in https://github.com/google/glog/pull/727
    • @anpol made their first contribution in https://github.com/google/glog/pull/775
    • @fkolarek made their first contribution in https://github.com/google/glog/pull/783
    • @fdgkhdkgh made their first contribution in https://github.com/google/glog/pull/776
    • @Arfrever made their first contribution in https://github.com/google/glog/pull/787
    • @git-hulk made their first contribution in https://github.com/google/glog/pull/790

    Full Changelog: https://github.com/google/glog/compare/v0.5.0...v0.6.0

    Source code(tar.gz)
    Source code(zip)
  • v0.6.0-rc2(Mar 20, 2022)

    What's Changed

    • bazel: Use glog 0.5.0 in README by @drigz in https://github.com/google/glog/pull/647
    • Expose IsGoogleLoggingInitialized() in public API. by @xkszltl in https://github.com/google/glog/pull/651
    • Fix cmake configuration for cygwin environment by @romange in https://github.com/google/glog/pull/656
    • Allow updating vmodule levels after vmodule level has been cached by @romange in https://github.com/google/glog/pull/650
    • Export COPYING by @fmeum in https://github.com/google/glog/pull/666
    • cmake: fixed msvc snprintf detection (fixes #668) by @sergiud in https://github.com/google/glog/pull/670
    • cmake: allow to override -fPIC by @sergiud in https://github.com/google/glog/pull/672
    • cmake: export <atomic> availability (fixes #667) by @sergiud in https://github.com/google/glog/pull/671
    • Remove ubuntu1604 from presubmit.yml by @philwo in https://github.com/google/glog/pull/677
    • bazel: add GLOG_CUSTOM_PREFIX_SUPPORT by @luliyucoordinate in https://github.com/google/glog/pull/676
    • log messages periodically (time-based) by @darbitman in https://github.com/google/glog/pull/669
    • ci: support more targets by @sergiud in https://github.com/google/glog/pull/686
    • cmake: prefer linking against gflags::gflags (fixes #683) by @sergiud in https://github.com/google/glog/pull/684
    • Fix syscall deprecation warning on macOS >= 10.12 by @z-aki in https://github.com/google/glog/pull/685
    • fixed exception specification mismatch by @sergiud in https://github.com/google/glog/pull/687
    • readme: fix wrong header id by @StephLin in https://github.com/google/glog/pull/674
    • eliminate warnings by @sergiud in https://github.com/google/glog/pull/688
    • fixed additional warnings by @sergiud in https://github.com/google/glog/pull/694
    • Add an static cast to compare unsigned with unsigned by @Fettpet in https://github.com/google/glog/pull/696
    • Fix: not implement virtual class when WITH_CUSTOM_PREFIX on by @Starsss in https://github.com/google/glog/pull/700
    • Change size type in AnnotateBenignRaceSized to size_t from long by @dfreese in https://github.com/google/glog/pull/706
    • Fix link error for Emscripten by @kinsei0916 in https://github.com/google/glog/pull/710
    • raw_logging.h depends on type definition in logging.h. by @xkszltl in https://github.com/google/glog/pull/713
    • export OS_* defines (fixes #715) by @sergiud in https://github.com/google/glog/pull/716
    • Fix syscall warning in Bazel Build by @ArthurBandaryk in https://github.com/google/glog/pull/718
    • Add -Werror to Bazel presubmits by @drigz in https://github.com/google/glog/pull/719
    • added gmock support by @sergiud in https://github.com/google/glog/pull/720
    • Support stack unwind on Android by @huangqinjin in https://github.com/google/glog/pull/708
    • add linux github workflow by @sergiud in https://github.com/google/glog/pull/722
    • ci: replace generated headers by templates by @sergiud in https://github.com/google/glog/pull/723
    • add mock log test by @sergiud in https://github.com/google/glog/pull/724
    • added log cleaner tests and fixed paths by @sergiud in https://github.com/google/glog/pull/732
    • Make LogCleaner support relative paths by @aesophor in https://github.com/google/glog/pull/654
    • cmake: Fix incorrect relative-path concatenation by @nh2 in https://github.com/google/glog/pull/733
    • Restore the stream format after writing the log prefix by @meyerj in https://github.com/google/glog/pull/731
    • fix glog-modules.cmake install by @sergiud in https://github.com/google/glog/pull/739
    • protect VLOG by use_logging by @sergiud in https://github.com/google/glog/pull/742
    • Fix log filename format by @cmsflash in https://github.com/google/glog/pull/747
    • Add Zhuoran Shen to AUTHORS and CONTRIBUTORS by @cmsflash in https://github.com/google/glog/pull/748
    • ci: reworked windows builds by @sergiud in https://github.com/google/glog/pull/737
    • cmake: set CMP0074 policy by @sergiud in https://github.com/google/glog/pull/751
    • ci: use codecov token by @sergiud in https://github.com/google/glog/pull/752
    • Added gmtoff() method in 'LogMessageTime' to get GMT offset by @vijaysattigeri in https://github.com/google/glog/pull/727
    • LogCleaner: Fix relative paths and add a new test by @aesophor in https://github.com/google/glog/pull/754
    • eliminate msvc warnings by @sergiud in https://github.com/google/glog/pull/757
    • cmake: require at least version 3.16 by @sergiud in https://github.com/google/glog/pull/758
    • ci: enable warnings as errors by @sergiud in https://github.com/google/glog/pull/759
    • LogCleaner: make overdue_days_ unsigned int by @aesophor in https://github.com/google/glog/pull/760
    • ci: remove deprecated msvc runner by @sergiud in https://github.com/google/glog/pull/762
    • provide backward compatible send overload by @sergiud in https://github.com/google/glog/pull/763
    • run clang-tidy by @sergiud in https://github.com/google/glog/pull/765
    • eliminate clang warnings by @sergiud in https://github.com/google/glog/pull/766
    • ensure _Unwind_Backtrace to actually be available by @sergiud in https://github.com/google/glog/pull/767
    • cmake: do not search for platform specific unwind by @sergiud in https://github.com/google/glog/pull/769
    • revert to signed int atomics by @sergiud in https://github.com/google/glog/pull/770
    • Add the "FLAG_log_year_in_prefix" by @msamoila in https://github.com/google/glog/pull/771
    • use uint32 for --max-log-size by @sergiud in https://github.com/google/glog/pull/773
    • stdcxx: eliminate excessive use of std::string::c_str() by @anpol in https://github.com/google/glog/pull/775
    • cmake: require at least gflags 2.2.2 by @sergiud in https://github.com/google/glog/pull/781
    • Changed my Email ID by @vijaysattigeri in https://github.com/google/glog/pull/782
    • On Solaris, GetHostName() returns empty string by @fkolarek in https://github.com/google/glog/pull/783
    • LogCleaner: avoid scanning logs too frequently by @fdgkhdkgh in https://github.com/google/glog/pull/776
    • libglog.pc: Set Libs.private for static linking by @Arfrever in https://github.com/google/glog/pull/787
    • cmake: enable custom prefix by default by @sergiud in https://github.com/google/glog/pull/788
    • simplify flags export by @sergiud in https://github.com/google/glog/pull/791
    • rename GOOGLE_GLOG_DLL_DECL to GLOG_EXPORT by @sergiud in https://github.com/google/glog/pull/764
    • cmake_package_config_generate: Fix CMake warnings with CMake 3.23 by @Arfrever in https://github.com/google/glog/pull/792
    • Tests: Respect TEST_TMPDIR, TMPDIR, TMP environmental variables by @Arfrever in https://github.com/google/glog/pull/794
    • Add the logtostdout and colorlogtostdout flag to allow logging to stdout by @git-hulk in https://github.com/google/glog/pull/790
    • Add clang-cl.exe to Bazel CI by @drigz in https://github.com/google/glog/pull/802
    • Fix "'GLOG_EXPORT' macro redefined" on clang-cl by @drigz in https://github.com/google/glog/pull/803
    • Fix namespace resolution issue in LOG_EVERY_T by @skeptic-monkey in https://github.com/google/glog/pull/801

    New Contributors

    • @xkszltl made their first contribution in https://github.com/google/glog/pull/651
    • @fmeum made their first contribution in https://github.com/google/glog/pull/666
    • @luliyucoordinate made their first contribution in https://github.com/google/glog/pull/676
    • @darbitman made their first contribution in https://github.com/google/glog/pull/669
    • @z-aki made their first contribution in https://github.com/google/glog/pull/685
    • @StephLin made their first contribution in https://github.com/google/glog/pull/674
    • @Fettpet made their first contribution in https://github.com/google/glog/pull/696
    • @Starsss made their first contribution in https://github.com/google/glog/pull/700
    • @dfreese made their first contribution in https://github.com/google/glog/pull/706
    • @kinsei0916 made their first contribution in https://github.com/google/glog/pull/710
    • @ArthurBandaryk made their first contribution in https://github.com/google/glog/pull/718
    • @nh2 made their first contribution in https://github.com/google/glog/pull/733
    • @meyerj made their first contribution in https://github.com/google/glog/pull/731
    • @cmsflash made their first contribution in https://github.com/google/glog/pull/747
    • @vijaysattigeri made their first contribution in https://github.com/google/glog/pull/727
    • @anpol made their first contribution in https://github.com/google/glog/pull/775
    • @fkolarek made their first contribution in https://github.com/google/glog/pull/783
    • @fdgkhdkgh made their first contribution in https://github.com/google/glog/pull/776
    • @Arfrever made their first contribution in https://github.com/google/glog/pull/787
    • @git-hulk made their first contribution in https://github.com/google/glog/pull/790

    Full Changelog: https://github.com/google/glog/compare/v0.5.0...v0.6.0-rc2

    Source code(tar.gz)
    Source code(zip)
  • v0.6.0-rc1(Feb 27, 2022)

    What's Changed

    • bazel: Use glog 0.5.0 in README by @drigz in https://github.com/google/glog/pull/647
    • Expose IsGoogleLoggingInitialized() in public API. by @xkszltl in https://github.com/google/glog/pull/651
    • Fix cmake configuration for cygwin environment by @romange in https://github.com/google/glog/pull/656
    • Allow updating vmodule levels after vmodule level has been cached by @romange in https://github.com/google/glog/pull/650
    • Export COPYING by @fmeum in https://github.com/google/glog/pull/666
    • cmake: fixed msvc snprintf detection (fixes #668) by @sergiud in https://github.com/google/glog/pull/670
    • cmake: allow to override -fPIC by @sergiud in https://github.com/google/glog/pull/672
    • cmake: export <atomic> availability (fixes #667) by @sergiud in https://github.com/google/glog/pull/671
    • Remove ubuntu1604 from presubmit.yml by @philwo in https://github.com/google/glog/pull/677
    • bazel: add GLOG_CUSTOM_PREFIX_SUPPORT by @luliyucoordinate in https://github.com/google/glog/pull/676
    • log messages periodically (time-based) by @darbitman in https://github.com/google/glog/pull/669
    • ci: support more targets by @sergiud in https://github.com/google/glog/pull/686
    • cmake: prefer linking against gflags::gflags (fixes #683) by @sergiud in https://github.com/google/glog/pull/684
    • Fix syscall deprecation warning on macOS >= 10.12 by @z-aki in https://github.com/google/glog/pull/685
    • fixed exception specification mismatch by @sergiud in https://github.com/google/glog/pull/687
    • readme: fix wrong header id by @StephLin in https://github.com/google/glog/pull/674
    • eliminate warnings by @sergiud in https://github.com/google/glog/pull/688
    • fixed additional warnings by @sergiud in https://github.com/google/glog/pull/694
    • Add an static cast to compare unsigned with unsigned by @Fettpet in https://github.com/google/glog/pull/696
    • Fix: not implement virtual class when WITH_CUSTOM_PREFIX on by @Starsss in https://github.com/google/glog/pull/700
    • Change size type in AnnotateBenignRaceSized to size_t from long by @dfreese in https://github.com/google/glog/pull/706
    • Fix link error for Emscripten by @kinsei0916 in https://github.com/google/glog/pull/710
    • raw_logging.h depends on type definition in logging.h. by @xkszltl in https://github.com/google/glog/pull/713
    • export OS_* defines (fixes #715) by @sergiud in https://github.com/google/glog/pull/716
    • Fix syscall warning in Bazel Build by @ArthurBandaryk in https://github.com/google/glog/pull/718
    • Add -Werror to Bazel presubmits by @drigz in https://github.com/google/glog/pull/719
    • added gmock support by @sergiud in https://github.com/google/glog/pull/720
    • Support stack unwind on Android by @huangqinjin in https://github.com/google/glog/pull/708
    • add linux github workflow by @sergiud in https://github.com/google/glog/pull/722
    • ci: replace generated headers by templates by @sergiud in https://github.com/google/glog/pull/723
    • add mock log test by @sergiud in https://github.com/google/glog/pull/724
    • added log cleaner tests and fixed paths by @sergiud in https://github.com/google/glog/pull/732
    • Make LogCleaner support relative paths by @aesophor in https://github.com/google/glog/pull/654
    • cmake: Fix incorrect relative-path concatenation by @nh2 in https://github.com/google/glog/pull/733
    • Restore the stream format after writing the log prefix by @meyerj in https://github.com/google/glog/pull/731
    • fix glog-modules.cmake install by @sergiud in https://github.com/google/glog/pull/739
    • protect VLOG by use_logging by @sergiud in https://github.com/google/glog/pull/742
    • Fix log filename format by @cmsflash in https://github.com/google/glog/pull/747
    • Add Zhuoran Shen to AUTHORS and CONTRIBUTORS by @cmsflash in https://github.com/google/glog/pull/748
    • ci: reworked windows builds by @sergiud in https://github.com/google/glog/pull/737
    • cmake: set CMP0074 policy by @sergiud in https://github.com/google/glog/pull/751
    • ci: use codecov token by @sergiud in https://github.com/google/glog/pull/752
    • Added gmtoff() method in 'LogMessageTime' to get GMT offset by @vijaysattigeri in https://github.com/google/glog/pull/727
    • LogCleaner: Fix relative paths and add a new test by @aesophor in https://github.com/google/glog/pull/754
    • eliminate msvc warnings by @sergiud in https://github.com/google/glog/pull/757
    • cmake: require at least version 3.16 by @sergiud in https://github.com/google/glog/pull/758
    • ci: enable warnings as errors by @sergiud in https://github.com/google/glog/pull/759
    • LogCleaner: make overdue_days_ unsigned int by @aesophor in https://github.com/google/glog/pull/760
    • ci: remove deprecated msvc runner by @sergiud in https://github.com/google/glog/pull/762
    • provide backward compatible send overload by @sergiud in https://github.com/google/glog/pull/763
    • run clang-tidy by @sergiud in https://github.com/google/glog/pull/765
    • eliminate clang warnings by @sergiud in https://github.com/google/glog/pull/766
    • ensure _Unwind_Backtrace to actually be available by @sergiud in https://github.com/google/glog/pull/767
    • cmake: do not search for platform specific unwind by @sergiud in https://github.com/google/glog/pull/769
    • revert to signed int atomics by @sergiud in https://github.com/google/glog/pull/770
    • Add the "FLAG_log_year_in_prefix" by @msamoila in https://github.com/google/glog/pull/771
    • use uint32 for --max-log-size by @sergiud in https://github.com/google/glog/pull/773
    • stdcxx: eliminate excessive use of std::string::c_str() by @anpol in https://github.com/google/glog/pull/775
    • cmake: require at least gflags 2.2.2 by @sergiud in https://github.com/google/glog/pull/781
    • Changed my Email ID by @vijaysattigeri in https://github.com/google/glog/pull/782
    • On Solaris, GetHostName() returns empty string by @fkolarek in https://github.com/google/glog/pull/783
    • LogCleaner: avoid scanning logs too frequently by @fdgkhdkgh in https://github.com/google/glog/pull/776
    • libglog.pc: Set Libs.private for static linking by @Arfrever in https://github.com/google/glog/pull/787
    • cmake: enable custom prefix by default by @sergiud in https://github.com/google/glog/pull/788
    • simplify flags export by @sergiud in https://github.com/google/glog/pull/791
    • rename GOOGLE_GLOG_DLL_DECL to GLOG_EXPORT by @sergiud in https://github.com/google/glog/pull/764
    • cmake_package_config_generate: Fix CMake warnings with CMake 3.23 by @Arfrever in https://github.com/google/glog/pull/792
    • Tests: Respect TEST_TMPDIR, TMPDIR, TMP environmental variables by @Arfrever in https://github.com/google/glog/pull/794
    • Add the logtostdout and colorlogtostdout flag to allow logging to stdout by @git-hulk in https://github.com/google/glog/pull/790

    New Contributors

    • @xkszltl made their first contribution in https://github.com/google/glog/pull/651
    • @fmeum made their first contribution in https://github.com/google/glog/pull/666
    • @luliyucoordinate made their first contribution in https://github.com/google/glog/pull/676
    • @darbitman made their first contribution in https://github.com/google/glog/pull/669
    • @z-aki made their first contribution in https://github.com/google/glog/pull/685
    • @StephLin made their first contribution in https://github.com/google/glog/pull/674
    • @Fettpet made their first contribution in https://github.com/google/glog/pull/696
    • @Starsss made their first contribution in https://github.com/google/glog/pull/700
    • @dfreese made their first contribution in https://github.com/google/glog/pull/706
    • @kinsei0916 made their first contribution in https://github.com/google/glog/pull/710
    • @ArthurBandaryk made their first contribution in https://github.com/google/glog/pull/718
    • @nh2 made their first contribution in https://github.com/google/glog/pull/733
    • @meyerj made their first contribution in https://github.com/google/glog/pull/731
    • @cmsflash made their first contribution in https://github.com/google/glog/pull/747
    • @vijaysattigeri made their first contribution in https://github.com/google/glog/pull/727
    • @anpol made their first contribution in https://github.com/google/glog/pull/775
    • @fkolarek made their first contribution in https://github.com/google/glog/pull/783
    • @fdgkhdkgh made their first contribution in https://github.com/google/glog/pull/776
    • @Arfrever made their first contribution in https://github.com/google/glog/pull/787
    • @git-hulk made their first contribution in https://github.com/google/glog/pull/790

    Full Changelog: https://github.com/google/glog/compare/v0.5.0...v0.6.0-rc1

    Source code(tar.gz)
    Source code(zip)
  • v0.5.0(May 7, 2021)

    Implemented enhancements:

    • Add support for customizing the prefix format #578
    • "sprintf" function being used in googletest.h which is not secure #536
    • stacktrace is not produced on aarch64 #531
    • Documenting minimum C++ version #527
    • Glog file separation by year #516
    • Bazel support for windows #472
    • GOOGLE_GLOG_DLL_DECL needs to be put into header file #469
    • Glog should delete old log files automaticly #423
    • CHECK_XX variants do not compile if nullptr is an argument #341
    • autogen.sh makes git directory dirty #308
    • LogSink::ToString has no microsecond precision. #307
    • Conan package for glog #262
    • How to change format of logger? for example time and verbose level name and etc #229
    • Username lookup needs a tuneup #211
    • Feature request for sudo make uninstall #163
    • glog should use ThreadSanitizer (TSAN) dynamic annotations #80
    • Add support for deleting old logs #36
    • CHECK support for nullptr (fixes #341) #641 (sergiud)
    • cmake: do not require a C compiler #627 (sergiud)
    • use C++ headers #626 (sergiud)
    • removed windows-specific headers #625 (sergiud)
    • document C++ version #623 (sergiud)
    • Add support for customizing the prefix format #554 (santigl)
    • Add extra information in log file header (application build/version, actual duration time) #438 (d-uspenskiy)
    • Use libunwind as an imported target #368 (UVV-gh)
    • Annotate LOG_EVERY_N macros as a benign race for TSAN #263 (kennyyu)

    Fixed bugs:

    • Incorrect Unwind version parser #598
    • Large integers get truncated #594
    • Windows shared library generates linkage warnings #569
    • Replace obsolete __CYGWIN64__ macro #566
    • Disabling 'Symbolize functionality' is not working #563
    • LOG_TO_STRING and std namespace #550
    • Ownership with SetLogger #524
    • gtest usage not implemented in CMake build system #510
    • ac_cv___attribute___printf_4_5 not set in CMake build system #509
    • --max_log_size not work when larger than 4096 #497
    • vmodule flag is not declared #466
    • TSan warning: a race in LOG_EVERY_N and friends #439
    • stacktrace unittest hangs on MSVC #328
    • EXC_BAD_ACCESS on iOS #275
    • Signal handler tests fail on ARM #256
    • glog 0.3.5 compilation failed on Centos 7 #243
    • ./libtool: line 6000: cd: no/lib: No such file or directory #215
    • Test stl_logging fails in macOS CMake build #201
    • autoconf build does not version the library #196
    • gcc 4.7.2, 4.8.3, 4.9.2 unit test failures on C++11 #14
    • fix gflags windows linker warnings #640 (sergiud)
    • fixed windows builds #639 (sergiud)
    • fix LogCleaner::IsLogFromCurrentProject for filename_extension #637 (xiaobfly)
    • fully qualify std::string #624 (sergiud)
    • handle --max_log_size overflow #622 (sergiud)
    • cmake: optionally use gtest #621 (sergiud)
    • cmake: allow to disable symbolize #620 (sergiud)
    • build: set ac_cv___attribute___printf_4_5 #618 (sergiud)
    • cmake: fixed unwind patch component match check #613 (sergiud)

    Closed issues:

    • call InitGoogleLogging get a segment fault #607
    • BUILD file will create a conflict with build/ folder #606
    • glog don't create log file in visual c++ dll project #605
    • error in CMAKE installation steps--$ git clone [email protected]:google/glog.git should change to $ git clone https://github.com/google/glog.git #603
    • No system link created along with the log files #599
    • CMake build instructions do not work for paths with ampersand #597
    • publicly visible Bazel target no longer provides any headers #596
    • LogCleaner::IsLogFromCurrentProject incorrect when SetLogFilenameExtension #589
    • EnableLogCleaner not recognized #586
    • IsGlogLog problem #584
    • Build fails with clang-cl due to undefined symbols #575
    • Write the correct Windows version in the log header #572
    • Ability to write time in UTC in log files #571
    • compile error: use of overloaded operator '<<' is ambiguous #562
    • glog error log was incorrrectly written to unexpected memory #561
    • How to disable logging. #556
    • Cannot compile "configure: WARNING: 'missing' script is too old or missing" #544
    • Support to modify verbose log level for mudules #538
    • Dropping autoconf support #537
    • Failed to print INFO and WARNING log #533
    • glog rpm installation fails if openstack-train repo is enabled #522
    • stripped binaries produce useless backtraces #514
    • Flag --incompatible_no_implicit_file_export will break Google Logging in a future Bazel release #512
    • Flag --incompatible_load_cc_rules_from_bzl will break Google Logging in Bazel 1.2.1 #507
    • Flag --incompatible_no_implicit_file_export will break Google Logging in Bazel 1.2.1 #506
    • Is there any way logging without a mutex #504
    • Including glog/logging.h triggers -Wunused-parameter on g++ #493
    • Bazel: building glog with custom version gflags #480
    • max_log_size flag does not work on AIX or linux #476
    • cmake/DetermineGflagsNamespace.cmake was ignored when repush #473
    • Conflict with gflags #458
    • log file name error after application restart #457
    • App security test reports Insecure API for React Native iOS App - Binary Analysis (IPA) #453
    • multi thread cant share glog setting #450
    • How do I write logs to files only? #436
    • Crash in symbolize_unittest on Ubuntu 18.04 x86_64 #435
    • Does glog support compress log files? #434
    • Bazel build doesn't set correct compile flags. #430
    • how to change the name of final dynamic library #427
    • suggest about gflags #426
    • about filename_extension_ in CreateLogfile #395
    • Add cc_library for ScopedMockLog #392
    • When building a react native project glog is causing a failure. #382
    • glog's endline is not thread safe when using with another logging system?! #379
    • Logfile full within 1s results in error #378
    • InitGoogleLogging bug ,Could not create logging file #375
    • golang/glog sometime can not create the log_dir? #369
    • static google::log_mutex destroyed on exit, while other still existing threads want to log #363
    • Does GLOG support log logs by day? #362
    • how to compile it for android ndk? #360
    • Cross Compile Error #358
    • add daemon(1,0) ,then log is missing #357
    • logtostderr filtering #356
    • Get trouble in compiling glog for android! #355
    • stl_logging unit test don't pass #348
    • Stacktrace is not printed by failure signal handler when built with Bazel #346
    • When might 0.3.6 be released? #345
    • Unittest generates warning with C++17 regarding auto_ptr #335
    • Use Upstream GoogleTest #333
    • Static declaration of 'pread' follows non-static declaration error while building in xcode #326
    • __declspec(dllimport) public: __thiscall google::base::CheckOpMessageBuilder::CheckOpMessageBuilder(char const *) #316
    • glog can't be compiled using Android NDK r16 #306
    • libunwind GetStackTrace implementation doesn't allow concurrent invocations #298
    • VLOG before InitGoogleLogging causes crash #290
    • macro 'AM_CONFIG_HEADER' not found in library #271
    • Print binary-identifying info at the top of each file #269
    • The spec.prepare_command lead an error #255
    • signalhandler_unittest tests fails on aarch64 #219
    • Compiling error: undefined references to `google::base::CheckOpMessageBuilder::NewString[abi:cxx11]() #195
    • [0.3.5] errors during make check #194
    • Allow coredump to be generated upon LOG(FATAL) #192
    • Thread ID on macOS #182
    • signalhandler_unittest tests fails on ppc64le #177
    • --without-gflags is not working #175
    • (gflags_reporting.cc.o): relocation R_X86_64_32 against.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC #174
    • Flag to give users choice to enable or disable time_pid_string attaching to the log file name #173
    • DCHECK_NOTNULL generates "expression result unused" errors with clang in strict compilation mode #172
    • C4722: destructor never returns potential memory leak #171
    • Logging to the same file from multiple processes #170
    • stacktrace_libunwind-inl.h: reentrancy check should use a thread-local instead of a global variable #160
    • Support vmodule filter support on non GNU compilers #154
    • can glog write to a specified file name? #147
    • Expose DumpStackTraceToString to application/user #144
    • Adding LOG_IF_OR_EVERY_N() #143
    • Support initializing logger and sinker by configuration #135
    • Logging UnitTest failed on x64 VS2015. Reason: Pointer format not consistent #134
    • source/logging_unittest.cc:64 error : 'GFLAGS_NAMESPACE' is not not a namespance-name #131
    • Allow glog to be queried as to whether or not InitGoogleLogging has been called. #125
    • Allow a log file to be simply named "foobar.log" with no appended string #124
    • Can I use default FailureSignalHandler() and my custom failure funcion together? #121
    • logging_fail fail for x64 in VS2013, libglog_static #119
    • travis env build failure : /bin/bash: aclocal-1.14: command not found #117
    • Allow more than just argv[0] in InitGoogleLogging #113
    • Can glog be shutdown totally? #111
    • A memory bug detected by valgrind? #109
    • src/demangle.h:80:27: error: expected initializer before 'Demangle' bool GOOGLE_GLOG_DLL_DECL Demangle(const char *mangled, char *out, int out_size); #108
    • glog fails to build on ARM64/AArch64 #107
    • logging_unittest-logging_unittest.o ERROR 1 #104
    • FATAL error with pthread_cancel in multi-thread program #102
    • configure: Hardcoded am__api_version='1.14' breaks build on systems with autoconf 1.15 #97
    • ppc64le support for glog #89
    • please remove generated autotools from the git repo #86
    • module based minloglevel #66
    • glog print wchar_t? #64
    • Android build is broken #59
    • libglog.pc.in should include libunwind as private dep for static linking case #57
    • demangle_unittest.sh fails with GCC 5 (configured --with-default-libstdcxx-abi=new, which is the default) #40
    • Make the documentation browsable online #39
    • Make error: failed to link with libgflags.a #38
    • Mark LOG(FATAL) with [[noreturn]] #28
    • Logfile with more restrictive permissions control #23
    • Asynchronous/double-buffering support? #16
    • clang34, 35, 36 fails to pass unit tests with C++03 #13

    Merged pull requests:

    Source code(tar.gz)
    Source code(zip)
  • v0.5.0-rc2(Apr 12, 2021)

    Implemented enhancements:

    • Add support for customizing the prefix format #578
    • stacktrace is not produced on aarch64 #531
    • Documenting minimum C++ version #527
    • GOOGLE_GLOG_DLL_DECL needs to be put into header file #469
    • CHECK_XX variants do not compile if nullptr is an argument #341
    • autogen.sh makes git directory dirty #308
    • Conan package for glog #262
    • How to change format of logger? for example time and verbose level name and etc #229
    • Username lookup needs a tuneup #211
    • Feature request for sudo make uninstall #163
    • glog should use ThreadSanitizer (TSAN) dynamic annotations #80
    • Add support for deleting old logs #36
    • CHECK support for nullptr (fixes #341) #641 (sergiud)
    • cmake: do not require a C compiler #627 (sergiud)
    • use C++ headers #626 (sergiud)
    • removed windows-specific headers #625 (sergiud)
    • document C++ version #623 (sergiud)
    • Add support for customizing the prefix format #554 (santigl)

    Fixed bugs:

    • Large integers get truncated #594
    • Windows shared library generates linkage warnings #569
    • Disabling 'Symbolize functionality' is not working #563
    • LOG_TO_STRING and std namespace #550
    • gtest usage not implemented in CMake build system #510
    • ac_cv___attribute___printf_4_5 not set in CMake build system #509
    • --max_log_size not work when larger than 4096 #497
    • vmodule flag is not declared #466
    • TSan warning: a race in LOG_EVERY_N and friends #439
    • stacktrace unittest hangs on MSVC #328
    • EXC_BAD_ACCESS on iOS #275
    • Signal handler tests fail on ARM #256
    • glog 0.3.5 compilation failed on Centos 7 #243
    • ./libtool: line 6000: cd: no/lib: No such file or directory #215
    • autoconf build does not version the library #196
    • gcc 4.7.2, 4.8.3, 4.9.2 unit test failures on C++11 #14
    • fix gflags windows linker warnings #640 (sergiud)
    • fixed windows builds #639 (sergiud)
    • fix LogCleaner::IsLogFromCurrentProject for filename_extension #637 (xiaobfly)
    • fully qualify std::string #624 (sergiud)
    • handle --max_log_size overflow #622 (sergiud)
    • cmake: optionally use gtest #621 (sergiud)
    • cmake: allow to disable symbolize #620 (sergiud)
    • build: set ac_cv___attribute___printf_4_5 #618 (sergiud)

    Closed issues:

    • call InitGoogleLogging get a segment fault #607
    • Build fails with clang-cl due to undefined symbols #575
    • compile error: use of overloaded operator '<<' is ambiguous #562
    • Support to modify verbose log level for mudules #538
    • max_log_size flag does not work on AIX or linux #476
    • App security test reports Insecure API for React Native iOS App - Binary Analysis (IPA) #453
    • How do I write logs to files only? #436
    • Does glog support compress log files? #434
    • Bazel build doesn't set correct compile flags. #430
    • how to change the name of final dynamic library #427
    • suggest about gflags #426
    • about filename_extension_ in CreateLogfile #395
    • Add cc_library for ScopedMockLog #392
    • When building a react native project glog is causing a failure. #382
    • glog's endline is not thread safe when using with another logging system?! #379
    • Logfile full within 1s results in error #378
    • InitGoogleLogging bug ,Could not create logging file #375
    • static google::log_mutex destroyed on exit, while other still existing threads want to log #363
    • Does GLOG support log logs by day? #362
    • how to compile it for android ndk? #360
    • Cross Compile Error #358
    • add daemon(1,0) ,then log is missing #357
    • logtostderr filtering #356
    • Get trouble in compiling glog for android! #355
    • stl_logging unit test don't pass #348
    • Unittest generates warning with C++17 regarding auto_ptr #335
    • Use Upstream GoogleTest #333
    • Static declaration of 'pread' follows non-static declaration error while building in xcode #326
    • __declspec(dllimport) public: __thiscall google::base::CheckOpMessageBuilder::CheckOpMessageBuilder(char const *) #316
    • glog can't be compiled using Android NDK r16 #306
    • VLOG before InitGoogleLogging causes crash #290
    • macro 'AM_CONFIG_HEADER' not found in library #271
    • Print binary-identifying info at the top of each file #269
    • The spec.prepare_command lead an error #255
    • signalhandler_unittest tests fails on aarch64 #219
    • Compiling error: undefined references to `google::base::CheckOpMessageBuilder::NewString[abi:cxx11]() #195
    • [0.3.5] errors during make check #194
    • Allow coredump to be generated upon LOG(FATAL) #192
    • Thread ID on macOS #182
    • signalhandler_unittest tests fails on ppc64le #177
    • --without-gflags is not working #175
    • (gflags_reporting.cc.o): relocation R_X86_64_32 against.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC #174
    • Flag to give users choice to enable or disable time_pid_string attaching to the log file name #173
    • DCHECK_NOTNULL generates "expression result unused" errors with clang in strict compilation mode #172
    • C4722: destructor never returns potential memory leak #171
    • Logging to the same file from multiple processes #170
    • Support vmodule filter support on non GNU compilers #154
    • can glog write to a specified file name? #147
    • Expose DumpStackTraceToString to application/user #144
    • Adding LOG_IF_OR_EVERY_N() #143
    • Support initializing logger and sinker by configuration #135
    • Logging UnitTest failed on x64 VS2015. Reason: Pointer format not consistent #134
    • source/logging_unittest.cc:64 error : 'GFLAGS_NAMESPACE' is not not a namespance-name #131
    • Allow glog to be queried as to whether or not InitGoogleLogging has been called. #125
    • Allow a log file to be simply named "foobar.log" with no appended string #124
    • Can I use default FailureSignalHandler() and my custom failure funcion together? #121
    • logging_fail fail for x64 in VS2013, libglog_static #119
    • travis env build failure : /bin/bash: aclocal-1.14: command not found #117
    • Allow more than just argv[0] in InitGoogleLogging #113
    • Can glog be shutdown totally? #111
    • A memory bug detected by valgrind? #109
    • src/demangle.h:80:27: error: expected initializer before 'Demangle' bool GOOGLE_GLOG_DLL_DECL Demangle(const char *mangled, char *out, int out_size); #108
    • glog fails to build on ARM64/AArch64 #107
    • logging_unittest-logging_unittest.o ERROR 1 #104
    • FATAL error with pthread_cancel in multi-thread program #102
    • configure: Hardcoded am__api_version='1.14' breaks build on systems with autoconf 1.15 #97
    • ppc64le support for glog #89
    • please remove generated autotools from the git repo #86
    • module based minloglevel #66
    • glog print wchar_t? #64
    • Android build is broken #59
    • libglog.pc.in should include libunwind as private dep for static linking case #57
    • demangle_unittest.sh fails with GCC 5 (configured --with-default-libstdcxx-abi=new, which is the default) #40
    • Make the documentation browsable online #39
    • Make error: failed to link with libgflags.a #38
    • Mark LOG(FATAL) with [[noreturn]] #28
    • Logfile with more restrictive permissions control #23
    • Asynchronous/double-buffering support? #16
    • clang34, 35, 36 fails to pass unit tests with C++03 #13

    Merged pull requests:

    Source code(tar.gz)
    Source code(zip)
  • v0.5.0-rc1(Mar 30, 2021)

    Implemented enhancements:

    • "sprintf" function being used in googletest.h which is not secure #536
    • Glog file separation by year #516
    • Bazel support for windows #472
    • Glog should delete old log files automaticly #423
    • LogSink::ToString has no microsecond precision. #307
    • Add extra information in log file header (application build/version, actual duration time) #438 (d-uspenskiy)
    • Use libunwind as an imported target #368 (UVV-gh)
    • Annotate LOG_EVERY_N macros as a benign race for TSAN #263 (kennyyu)

    Fixed bugs:

    • Incorrect Unwind version parser #598
    • Replace obsolete __CYGWIN64__ macro #566
    • Ownership with SetLogger #524
    • Test stl_logging fails in macOS CMake build #201
    • cmake: fixed unwind patch component match check #613 (sergiud)

    Closed issues:

    • BUILD file will create a conflict with build/ folder #606
    • glog don't create log file in visual c++ dll project #605
    • error in CMAKE installation steps--$ git clone [email protected]:google/glog.git should change to $ git clone https://github.com/google/glog.git #603
    • No system link created along with the log files #599
    • CMake build instructions do not work for paths with ampersand #597
    • publicly visible Bazel target no longer provides any headers #596
    • LogCleaner::IsLogFromCurrentProject incorrect when SetLogFilenameExtension #589
    • EnableLogCleaner not recognized #586
    • IsGlogLog problem #584
    • Write the correct Windows version in the log header #572
    • Ability to write time in UTC in log files #571
    • glog error log was incorrrectly written to unexpected memory #561
    • How to disable logging. #556
    • Cannot compile "configure: WARNING: 'missing' script is too old or missing" #544
    • Dropping autoconf support #537
    • Failed to print INFO and WARNING log #533
    • glog rpm installation fails if openstack-train repo is enabled #522
    • stripped binaries produce useless backtraces #514
    • Flag --incompatible_no_implicit_file_export will break Google Logging in a future Bazel release #512
    • Flag --incompatible_load_cc_rules_from_bzl will break Google Logging in Bazel 1.2.1 #507
    • Flag --incompatible_no_implicit_file_export will break Google Logging in Bazel 1.2.1 #506
    • Is there any way logging without a mutex #504
    • Including glog/logging.h triggers -Wunused-parameter on g++ #493
    • Bazel: building glog with custom version gflags #480
    • cmake/DetermineGflagsNamespace.cmake was ignored when repush #473
    • Conflict with gflags #458
    • log file name error after application restart #457
    • multi thread cant share glog setting #450
    • Crash in symbolize_unittest on Ubuntu 18.04 x86_64 #435
    • golang/glog sometime can not create the log_dir? #369
    • Stacktrace is not printed by failure signal handler when built with Bazel #346
    • When might 0.3.6 be released? #345
    • libunwind GetStackTrace implementation doesn't allow concurrent invocations #298
    • stacktrace_libunwind-inl.h: reentrancy check should use a thread-local instead of a global variable #160

    Merged pull requests:

    Source code(tar.gz)
    Source code(zip)
  • v0.4.0(Mar 22, 2019)

    • build: cleanup temps and remove NEWS by @jackwish (#410)
    • Fix unused variable warning in GCC by @pwnall (#412)
    • automake: relax GNU standard directory style by @jackwish (#408)
    • update README.md filename in Makefile.am by @NeroBurner (#403)
    • ci: add clang-cxx17 toolchain by @NeroBurner (#406)
    • remove register keyword from unittest by @NeroBurner (#405)
    • Use push/pop macro when supressing warning by @kwaegel (#397)
    • ci: add appveyor and travis config by @NeroBurner (#330)
    • Make symbolize.cc thread safe even on shared fds by @tzik (#388)
    • Don't crash on some forms of invalid ELF files by @bsilver8192 (#367)
    • Fix mistype in comment by @zaporozhets (#371)
    • Fix errors with BUILD_SHARED_LIBS=ON for Visual Studio 2017 (fixes #343) by @dzung (#344)
    • fix glog.html link to gflags repository by @NeroBurner (#336)
    • Delete NEWS by @NeroBurner (#337)
    • Fix windows logging unittest by @NeroBurner (#331)
    • tests: fix compilation with C++17 by @NeroBurner (#332)
    • Fix mingw cross compile by @NeroBurner (#324)
    • Resolve missing prototype warning by @Nazg (#302)
    • Fix redefined warnings from config.h by @Nazg (#303)
    • Make int conversion explicit and fix clang warning by @samuela (#305)
    • konsole family of terminfo supports colored output by @Nazg (#304)
    • CMake Update by @Mizux (#292)
    • Use target gflags instead of old VARIABLES by @Mizux (#283)
    • Add an example using glog from Bazel by @drigz (#276)
    • Update gflags to latest master by @drigz (#277)
    • Fixed undeclared identifier error by @sergiud (#281)
    • Build with Bazel. by @qzmfranklin (#232)
    • Compute base addresses from program headers while reading /proc/self/maps. by @pcc (#261)
    • Cache strlen outside of cycles (PVS-Studio) by @dimhotepus (#106)
    • Shell escape arguments to /bin/mail. by @ukai (#260)
    • Fix username lookup in case of missing USER environment variable by @DariuszOstolski (#245)
    • #253: Use MS preprocessor idiom to disable warning by @DariuszOstolski (#254)
    • Zero allocation fix by @sergiud (#226)
    • Fix for missing exports (fixes #227) by @sergiud (#228)
    • Fix LOG_EVERY_N with clang -Wunused-local-typedef by @jray272 (#225)
    • Run src/windows/preprocess.sh to pick up latest logging.h.in changes by @jray272 (#224)
    • Update Windows docs by @andschwa (#218)
    • cmake: fixed gflags namespace detection (fixes #193) by @sergiud (#209)
    • cmake: do not hardcode relative install directories by @sergiud (#153)
    • cmake: changed project name from google-glog to glog by @sergiud (#152)
    • Cygwin support by @sergiud (#157)
    • [RFC] reduce heap memory allocations to zero by @sergiud (#158)
    • rate limit calls to posix_fadvise() by @pixelb (#145)
    • Use gflags ALIAS instead of ${gflags_XXX} vars by @v1bri (#199)
    • Port stack tracing to Windows by @andschwa (#168)
    Source code(tar.gz)
    Source code(zip)
  • v0.3.5(May 10, 2017)

    • CHECK_NOTNULL works with smart pointers when compiled in C++11
    • Add __declspec(noreturn) on Win
    • DCHECK_ALWAYS_ON to make D* enabled under NDEBUG
    • MinGW: avoid the error "conflicting declaration 'typedef DWORD pthread_t'" etc.
    • NULL sinks_ after deletion to prevent dangling pointer
    • Symbolize: Calculate a module's zero VA using program headers
    • Allow permission line in /proc/self/map to be "rwx"
    • Add support for PowerPC
    • Use namespace GFLAGS_NAMESPACE instead namespace gflags. #62
    • Win: use _fdopen instead of fdopen. Fix #73
    • Win: FAILED macro can't be used with HANDLE. Fix #79
    • Avoid calling new/malloc in signalhandler to fix #78
    • Reset SIGABRT action only if FailureSignalHandler is installed
    • Fix missing public include directory
    • Fix double-free in unit test on Windows
    • Add logfile_mode to control logfile permissions to fix #23
    • Fix mocklog unused arguments
    • Fix redefinition of _XOPEN_SOURCE
    • Don't call RAW_VLOG with locking vmodule_lock to fix #29
    • Add CMake support. closes #4
    • Fix #8 AddLogSink memory leak
    • Add #ifndefs to avoid collision with other google opensource projects
    • LOG_STRING: use std::vector and std::string
    • Adds color output support for tmux terminals
    • Fix x64/Debug build on MSVS
    Source code(tar.gz)
    Source code(zip)
  • v0.3.4(Mar 11, 2015)

    google-glog 0.3.4

    • repository moved from code.google.com/p/google-glog to github.com/google/glog
    • fixes for latest MSVS
    • add libc++ support
    • fix build issue in demangle.cc
    • add callback for OpenObjectFileContainingPcAndGetStartAddress
    • add StrError and replace posix_strerror_r call
    • fix VC build by adding GOOGLE_GLOG_DLL_DECL
    • style fix for C++11
    • reduce dynamic allocation from 3 to 1 per log message
    • attempt to improve mingw-w64 support
    • support unordered_(map|set) by stl_logging
    Source code(tar.gz)
    Source code(zip)
Owner
Google
Google ❤️ Open Source
Google
Reckless logging. Low-latency, high-throughput, asynchronous logging library for C++.

Introduction Reckless is an extremely low-latency, high-throughput logging library. It was created because I needed to perform extensive diagnostic lo

Mattias Flodin 445 Dec 20, 2022
Colorful Logging is a simple and efficient library allowing for logging and benchmarking.

Colorful-Logging "Colorful Logging" is a library allowing for simple and efficient logging as well for benchmarking. What can you use it for? -Obvious

Mateusz Antkiewicz 1 Feb 17, 2022
Yet another logging library.

Blackhole - eating your logs with pleasure Blackhole is an attribute-based logger with strong focus on gaining maximum performance as possible for suc

Evgeny Safronov 191 Dec 20, 2022
log4cplus is a simple to use C++ logging API providing thread-safe, flexible, and arbitrarily granular control over log management and configuration. It is modelled after the Java log4j API.

% log4cplus README Short Description log4cplus is a simple to use C++17 logging API providing thread--safe, flexible, and arbitrarily granular control

null 1.4k Jan 4, 2023
A lightweight C++ logging library

Loguru: a lightweight and flexible C++ logging library. At a glance Documentation Documentation can be found at https://emilk.github.io/loguru/index.h

Emil Ernerfeldt 1.5k Jan 7, 2023
Portable, simple and extensible C++ logging library

Plog - portable, simple and extensible C++ logging library Pretty powerful logging library in about 1000 lines of code Introduction Hello log! Feature

Sergey Podobry 1.6k Dec 29, 2022
Fast C++ logging library.

spdlog Very fast, header-only/compiled, C++ logging library. Install Header only version Copy the source folder to your build tree and use a C++11 com

Gabi Melman 16.6k Jan 1, 2023
Asynchronous Low Latency C++ Logging Library

Quill Asynchronous Low Latency C++ Logging Library Introduction Features Performance Supported Platforms And Compilers Basic Usage CMake Integration D

Odysseas Georgoudis 677 Dec 20, 2022
Cute Log is a C++ Library that competes to be a unique logging tool.

Cute Log Cute Log is a C++ Library that competes to be a unique logging tool. Version: 2 Installation Click "Code" on the main repo page (This one.).

null 3 Oct 13, 2022
fmtlog is a performant fmtlib-style logging library with latency in nanoseconds.

fmtlog fmtlog is a performant asynchronous logging library using fmt library format. Features Faster - lower runtime latency than NanoLog and higher t

Meng Rao 443 Jan 6, 2023
Minimalistic logging library with threads and manual callstacks

Minimalistic logging library with threads and manual callstacks

Sergey Kosarevsky 20 Dec 5, 2022
A Fast and Convenient C++ Logging Library for Low-latency or Real-time Environments

xtr What is it? XTR is a C++ logging library aimed at applications with low-latency or real-time requirements. The cost of log statements is minimised

null 10 Jul 17, 2022
Uberlog - Cross platform multi-process C++ logging system

uberlog uberlog is a cross platform C++ logging system that is: Small Fast Robust Runs on Linux, Windows, OSX MIT License Small Two headers, and three

IMQS Software 15 Sep 29, 2022
logog is a portable C++ library to facilitate logging of real-time events in performance-oriented applications

logog is a portable C++ library to facilitate logging of real-time events in performance-oriented applications, such as games. It is especially appropriate for projects that have constrained memory and constrained CPU requirements.

John Byrd 46 Oct 21, 2020
Boost Logging library

Boost.Log, part of collection of the Boost C++ Libraries, provides tools for adding logging to libraries and applications. Directories build - Boost.L

Boost.org 157 Dec 22, 2022
📝 Kernel module that can be used as a replacement for logger or logwrapper

Kernel logger Kernel logger is a kernel module that can be used as a replacement for logger or logwrapper. Its log is similar to systemd's journal and

Tian Yuanhao 38 May 21, 2022
A single file, public domain C implementation of aSchroeder reverb.

Introduction This is a reverb implementation based on Freeverb, a public domain reverb written by Jezar at Dreampoint in 2000. The library is written

Philip Bennefall 55 Nov 27, 2022