Commit Graph

445 Commits

Author SHA1 Message Date
Sergiu Deitsch
024b095d7e
Merge pull request #552 from huangqinjin/master
Make message text null-terminated
2020-09-29 22:11:22 +02:00
Sergiu Deitsch
d442460690
Merge pull request #579 from arj-fb/safety_check_at_SymbolizeAndDemangle
Added check for if info.dli_sname is NULL
2020-09-29 22:10:08 +02:00
Santiago Gil
7258189847 Add override to LogStreamBuf::overflow()
Prevents warnings such as:
```
glog/logging.h:1122:20: error: ‘virtual
std::basic_streambuf<char>::int_type
google::base_logging::LogStreamBuf::overflow(std::basic_streambuf<char>::int_type)’
can be marked override [-Werror=suggest-override]
   virtual int_type overflow(int_type ch) {
                    ^~~~~~~~
```

Signed-off-by: Santiago Gil <santiago.gil@codethink.co.uk>
2020-09-24 10:48:00 +01:00
Arjun Moudgil
e5ef2728bd Added check for if info.dli_sname is NULL
Check if info.dli_sname is NULL,
If the image containing addr is found, but no nearest symbol was found, the dli_sname and dli_saddr fields are set to NULL.
2020-09-15 20:46:35 -04:00
M Samoila
909069ea82 Add FLAGS_log_utc_time; when 'true' the time will be written in log in UTC 2020-09-01 10:55:53 -07:00
Jiuqiang Tang
64650ef2ed
Connect glog to Andorid logging API
In LogMessage::Flush(), write to __android_log_write() so that the messages can be seen via "adb logcat".

This is already a patch in the Google MediaPipe's repo: https://github.com/google/mediapipe/blob/master/third_party/com_github_glog_glog_9779e5ea6ef59562b030248947f787d1256132ae.diff.
2020-08-21 20:24:00 -07:00
huangqinjin
0a12a96cee Output to logcat on Android 2020-05-11 23:59:00 +08:00
huangqinjin
d8998fe4f6 Make message text null-terminated 2020-05-11 22:33:17 +08:00
Marco Wang
2e87f98fe4 Replace sprintf() with snprintf() (#536)
sprintf poses two security risks:
(1) write to memory where it shouldn't
(2) read from memory where it shouldn't

This commit replaces the use of sprintf() with snprintf()
which has a size parameter to ensure the problems mentioned
above won't take place.
2020-05-08 14:50:55 +08:00
Charlène Wendling
7001ab9ecb OpenBSD/powerpc: clang does not define _CALL_* use proper ifdef
OpenBSD/macppc uses now clang by default and does not define _CALL_SYSV,
use the alternative for such platforms.
2020-04-27 15:50:32 +02:00
Longwu Ou
4a82a856d2 Use NULL to indicate uninitialized VLOG_IS_ON site. 2020-04-26 22:57:58 -04:00
Dmitry Uspenskiy
ceb7163880 Add extra information in log file header (application build/version, actual duration time) 2020-03-25 09:55:32 +01:00
Sergiu Deitsch
28321d8959
Merge pull request #503 from alexsmac/fix-custom-logger-deletion
Fix missing deletion of custom Logger
2020-03-25 09:52:26 +01:00
Marco
5b4fb63d27
Prepend the year to each glog line (#516) (#530)
* Prepend the year to each glog line (#516)

This PR fixes issue #516 by prepending the year to each glog line.

Previous format of each line in a log file:
[IWEF]mmdd hh:mm:ss.uuuuuu threadid file:line] msg

New format:
[IWEF]yyyymmdd hh:mm:ss.uuuuuu threadid file:line] msg

* Fix logging_unittest for PR #530

Since the format of each glog line has been changed,
the logging_unittest must also be updated.
2020-03-25 09:36:28 +01:00
Florian Mayer
74076bebc3 Explain log levels. 2020-01-10 10:50:12 +00:00
Michael Spang
130a3e10de Use file offsets in traces if object has no symbols (#513)
Fallback to using file offsets if no symbol is found, like we do if the
object could not be opened.

This makes backtraces usable even if objects in the trace are stripped,
since the trace can be symbolized by post-processing it with a tool like
asan_symbolize.py.

Note that this is not currently compatible with SymbolizeCallback as
this overwrites the filename in the buffer. The behavior is unchanged
in that case.

Closes: #514
2020-01-08 15:34:39 +09:00
Changli Gao
a35e612c55 Don't call close(2) more than once
Don't call close(2) more then once, even though close(2) returns -1.

See the manual page for details.
2019-12-21 23:24:28 +08:00
Marco Wang
36fa99ba2c src/logging.cc: check the entire filename format 2019-12-09 08:48:41 +08:00
Alex Stewart
0a6704b439 Fix missing deletion of custom Logger
- If the user specifies a custom Logger via SetLogger(), the docs state
  that the logging module takes ownership of it.  Prior to this change,
  the logging library was not deleting a custom logger when the
  LogDestination which owns it was destroyed.
2019-12-02 16:55:08 +00:00
Marco Wang
7764e4a8b4 src/logging.cc: match logfile with base_filename 2019-12-01 22:06:12 +08:00
Marco Wang
3b5f2807f4 src/logging.cc: encapsulate log cleaner 2019-12-01 19:12:06 +08:00
Sergiu Deitsch
1863b4228c
Merge pull request #368 from UVV-gh/cmake-sdk-fix
Use libunwind as an imported target
2019-11-10 17:02:31 +01:00
Sergiu Deitsch
c0463b17b6 added cmake package config unit test 2019-11-10 15:46:47 +01:00
Sergiu Deitsch
9a43cfb8d2 install unwind find module alongside glog 2019-11-10 11:09:18 +01:00
Ezequiel Lara Gomez
58d7f873dc Added fixed log name support, take 2 (#489)
* Added fixed log name support, take 2

See https://code.google.com/p/google-glog/issues/detail?id=209 and former https://github.com/google/glog/pull/19 - this is an updated version of that patch.

It adds a flag that allows to switch behavior from base_filename + filename_extension + time_pid_string to base_filename + filename_extension, while still defaulting to the current behavior to avoid breakage in existing code. This change would allow easier log rotation schemes and better control on what's written on disk.

* Ifdef away fcntl on mingw

* Use the defined HAVE_FCNTL instead

* ifdef away tests as well

add have_sys_wait for wait() on mingw.

* OS_WINDOWS bug in fseeking to the end, only triggered here
2019-11-06 12:49:01 +01:00
yww
e58e596f13 src/logging.cc: fix wrong assignment 2019-11-04 14:35:26 +08:00
Fabrice Fontaine
3ee89c86d6 src/symbolize.cc: do not check for HAVE_DLFCN_H for macOS
This seems to raise a build failure, see
10498b485f (commitcomment-35770392)

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
2019-11-02 10:41:05 +01:00
Fabrice Fontaine
9630e0e848 src/utilities: fix build without pthread
- Remove is_default_thread function which is an internal and not used
  function
- Remove g_main_thread_id as it was used only by is_default_thread

Fixes:
 - http://autobuild.buildroot.net/results/5320bbe1205e782e3516d9bead8d1ed825bcbaad

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
2019-11-02 02:09:07 +01:00
Sergiu Deitsch
e0a2521e3d
Merge pull request #482 from google/revert-19-master
Revert "Added fixed log name support"
2019-11-01 13:26:53 +01:00
Marco
a6f7be14c6 Add support for automatic removal of old logs (#432)
* Add support for automatic removal of old logs

GetOverdueLogNames(string log_directory, int days) will check all
filenames under log_directory, and return a list of files whose last modified time is
over the given days (calculated using difftime()).

So that we can easily for unlink all files stored in the returned vector.

* Replaced the lines that require C++11

* embed dirent.h in project

* Add support for automatic removal of old logs

In this commit, at the end of LogFileObject::Write,
it will perform clean up for old logs.

It uses GetLoggingDirectories() and for each file in each
directory, it will check if a file is a log file produced by glog.
If it is, and it is last modified 3 days ago, then it will unlink()
this file. (It will only remove the project's own log files,
it won't remove the logs from other projects.)

Currently it is hardcoded to 3 days, I'll see if this can be
implemented in a more flexible manner.

* Implement old log cleaner

The log cleaner can be enabled and disabled at any given time.
By default, the log cleaner is disabled.

For example, this will enable the log cleaner and delete
the log files whose last modified time is >= x days
google::EnableLogCleaner(x days);

To disable it, simply call
google::DisableLogCleaner();

Please note that it will only clean up the logs produced for
its own project, the log files from other project will be untouched.

* logging: log_cleaner: Use blackslash for windows dir delim

* logging: log_cleaner: remove the range-based loops

Also replaced the hardcoded overdue days with the correct variable.

* Add Marco Wang to AUTHORS and CONTRIBUTORS

* logging: log_cleaner: Remove redundant filename stripping

Previously the full path to a file is passed into IsGlogLog(),
and then std::string::erase() is used to get the filename part.
If a directory name contains '.', then this function will be unreliable.

Now only the filename it self is passed into IsGlogLog(),
so this problem will be eradicated.

* logging: log_cleaner: improve readability

* Add google::EnableLogCleaner() to windows logging.h

* logging: log_cleaner: Remove perror message

* logging: IsGlogLog: match filename keyword by keyword

Splitting a filename into tokens by '.' causes problems
if the executable's filename contains a dot.

Filename should be matched keyword by keyword in the following
order:
1. program name
2. hostname
3. username
4. "log"
2019-11-01 12:20:11 +01:00
Sergiu Deitsch
15fb5ca5b6
Revert "Added fixed log name support" 2019-11-01 12:01:41 +01:00
Sergiu Deitsch
5792d60d68
Merge pull request #441 from asekretenko/useconds
Extend the LogSink interface to be able to pass microseconds
2019-10-31 23:43:50 +01:00
Sergiu Deitsch
44f6079fad
Merge pull request #19 from ezegomez/master
Added fixed log name support
2019-10-31 23:40:55 +01:00
Sergiu Deitsch
242130d305
Merge pull request #350 from TheModMaker/fixIosSim
Allow getpwuid_r to return missing entry.
2019-10-31 23:00:31 +01:00
Sergiu Deitsch
f17d11aa8c
Merge pull request #161 from mpercy/thread-local-libunwind-2
Use thread local for libunwind GetStackTrace() reentrancy protection
2019-10-31 22:54:34 +01:00
Sergiu Deitsch
1227cf4dab
Merge pull request #312 from ruslo/pr.api21
Fix build for Android API < 21
2019-10-31 22:52:04 +01:00
Sergiu Deitsch
0f83e53c43
Merge pull request #443 from ammubhave/fix_musl_build
Fix symbolize_unittest for musl builds
2019-10-31 22:45:26 +01:00
Sergiu Deitsch
e558d50b0a
Merge pull request #370 from hemantbits/patch-1
Fix warnings
2019-10-31 22:44:48 +01:00
Sergiu Deitsch
30f7f3ee93
Merge pull request #479 from neheb/patch-2
logging: Fix compilation with uClibc++
2019-10-31 22:42:13 +01:00
Rosen Penev
e24276a35e
logging: Fix compilation with uClibc++
uClibc++ has compiler support for C++11, but not the functions.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2019-10-31 13:04:29 -07:00
Rosen Penev
1d762fa5b0
googletest: Switch to nanosleep
usleep is deprecated and optionally not available with uClibc-ng.
2019-10-31 13:00:48 -07:00
Fabrice Fontaine
10498b485f src/symbolize.cc: fix build without dlfcn.h
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
2019-10-29 22:12:39 +01:00
sukill
1e6b9f3291 declare FLAGS_vmodule 2019-09-04 18:39:21 +09:00
Fumitoshi Ukai
ba8a9f6952
fix typo: TOOD -> TODO (#448) 2019-05-07 16:02:06 +09:00
Amol Bhave
834dd780bf Fix symbolize_unittest for musl builds
When glog 0.4.0 is built using musl instead of glibc, the compilation
for this test fails because musl doesn't provide execinfo.h, which sets
HAVE_STACKTRACE to false.

Tested by building glog with musl and verifying that the build succeeds
with this patch. [See https://github.com/openwrt/packages/pull/8583]

Signed-off-by: Amol Bhave <ambhave@fb.com>
2019-04-03 12:08:35 -07:00
Andrei Sekretenko
94a54120de Extended the LogSink interface to be able to pass microseconds. 2019-03-27 18:27:31 +01:00
Shinichiro Hamaji
96a2f23dca
Merge pull request #419 from shinh/release-0-4-0
Release 0.4.0
2019-03-22 11:51:46 +09:00
romkatv
4db0631346 Protect macros from user code to the left of them 2019-02-16 19:23:36 +01:00
Shinichiro Hamaji
460ec1f564 Merge branch 'master' into release-0-4-0 2019-02-14 17:46:12 +09:00
Shinichiro Hamaji
41f4bf9cbc
Merge pull request #425 from plmuon/remove-time-from-raw-logging
remove time from raw logging
2019-02-02 11:00:29 +09:00
Shinichiro Hamaji
64041397b3 Use static to define CheckStackTrace on non-GNU (#429)
for `&CheckStackAddress`, VisualStudio emits address of a trampoline like PLT, 
not the actual address of `CheckStackTrace`.

We need address of `CheckStackTrace` to guess the address range of the function.
`static` function seems to return the actual address of the function.

Fixes #421
2019-02-02 10:13:43 +09:00
Shinichiro Hamaji
7f91846ca1 Stop using auto_ptr (#428)
Stop using auto_ptr

std::unique_ptr requires -std=c++11. just use raw pointer.
2019-02-01 17:35:02 +09:00
Peter Mutsaers
e5588de96d remove time from raw logging 2019-01-29 23:38:03 +01:00
Shinichiro Hamaji
ed1ef7c4db Apply #397 to glog/logging.h.in
windows/glog/logging.h is expected to be generated by
src/windows/preprocess.sh and should not be modified directly.
2019-01-24 09:25:43 +09:00
Ky Waegel
342fa2674c
Use push/pop macro when supressing warning
* Same as PR #397 , but for the `.in` file. Useful for some unusual cross-platform build environments (e.g. WSL).
2019-01-22 10:59:05 -08:00
Shinichiro Hamaji
6d6d31872e Run src/windows/preprocess.sh 2019-01-22 20:58:13 +09:00
Haakan Younes
5d46e1bcfc Add demangle support for ABI tags. (#416)
Support ABI tags after <local-source-name> in demangle.cc.
Update the reference URL.

Fixes #50
2019-01-07 15:30:23 +09:00
Thomas Anderson
7fcb278d1e Fix demangling template parameter packs (#414)
* Fix demangling template parameter packs

Clang 4.0.1-10 and gcc 7.3.0 both mangle the function "void add<int>(int)" as
"_Z3addIJiEEvDpT_".  The template parameter pack is of the form
J <template-arg>* E

The opening character for a param pack could be either I or J, as libiberty
follows [1].  This change simply adds the J case.

[1] fbd263526a/libiberty/cp-demangle.c (L3209)
2019-01-07 15:26:08 +09:00
Sergiu Deitsch
0e4ce7c0c0
Merge pull request #410 from jackwish/fix/build/cleanup
build: cleanup temps and remove NEWS
2019-01-01 01:27:42 +01:00
Victor Costan
0989ffadb8 Fix unused variable warning in GCC. 2018-12-25 16:54:08 -08:00
王振华 (WANG Zhenhua)
5a22c3cdc0 build: remove automake temporaries 2018-12-19 11:54:06 +00:00
NeroBurner
e0cabc5404 remove register keyword from unittest 2018-12-13 08:15:52 +01:00
Sergiu Deitsch
702c533ce0
Merge pull request #397 from kwaegel/patch-1
Use push/pop macro when supressing warning
2018-12-12 10:18:17 +01:00
Roman Gershman
6adf6d7ae5 fix debug build using gcc -fsanitize=undefined (#374) 2018-12-12 10:16:49 +01:00
Ky Waegel
615d0b9712
Use push/pop macro when supressing warning
* Previous implementation did not correctly restore the warning state if initially disabled.
2018-11-27 17:35:07 -08:00
Taiju Tsuiki
781096619d Upstream Chromium local changes to symbolize.cc (#391)
* Upstream Chromium local changes to symbolize.cc

Chromium has its own fork of symbolize.cc and symbolize.h, and it has
several not-yet-upstreamed changes, that are not specific to Chromium.

This patch upstreams such a changes.

  Fixed google::FindSymbol reading past end of a section
  3dae0a2d7d

  Fix -INT_MIN integer overflow in itoa_r().
  ac4d28e9cb

  Add print_unsymbolized_stack_traces gn arg.
  6a2726776f

  Switch to standard integer types in base/.
  9b6f42934e

* Add a build option to print unsymbolized traces

This PRINT_UNSYMBOLIZED_STACK_TRACES option to cmake, and
--enable-unsymbolized-traces option to autoconf.
2018-11-21 11:14:38 +09:00
tzik
1081df6e5c Make symbolize.cc thread safe even on shared fds
ReadFromOffset in symbolize.cc used to call lseek() + read() to read
data from fd. However, the fd may be reused for multiple symbolize
requests from multiple threads, and causes a race around the fd read
offset.

This updates it to use pread() to resolve the race.
2018-11-13 12:55:09 +09:00
Sergiu Deitsch
e364e754a6
Merge pull request #367 from bsilver8192/master
Don't crash on some forms of invalid ELF files
2018-10-23 21:50:06 +02:00
Taras Zaporozhets
a9393f0909 Fix mistype in comment 2018-10-17 15:54:37 +03:00
Hemant
41a6a7880e
Fix warnings
Fixed these warnings:

src/logging_unittest.cc: At global scope:
src/logging_unittest.cc:1081:13: warning: 'void MyCheck(bool, bool)' defined but not used [-Wunused-function]
 static void MyCheck(bool a, bool b) {
             ^~~~~~~
src/logging_unittest.cc:1078:13: warning: 'void MyFatal()' defined but not used [-Wunused-function]
 static void MyFatal() {
             ^~~~~~~
2018-10-12 13:25:19 +01:00
Brian Silverman
91e3fdcefc Don't crash on some forms of invalid ELF files
With a few tweaks, it will fail to look up symbol names in these cases
instead.
2018-09-18 17:08:27 -07:00
Jacob Trimble
a606c3187b Allow getpwuid_r to return missing entry.
If the getpwuid_r method doesn't find an entry with the given ID, it
will still return success (0), but the *result will be set to NULL.
This checks the |result| value so it won't crash if it doesn't find
the entry.

This normally shouldn't ever happen, but it can somehow happen on
iOS simulators.
2018-07-27 10:58:18 -07:00
Dzung Hoang
87b82b2362 fix errors with BUILD_SHARED_LIBS=ON for Visual Studio 2017 2018-07-16 02:10:05 -05:00
Sergiu Deitsch
3267f3e1a8
Merge pull request #331 from NeroBurner/fix_windows_logging_ut
Fix windows logging ut
2018-06-29 12:31:45 +02:00
NeroBurner
5fa1d59065 tests: fix compilation with C++17
Remove throw() commands as they were deprecated with C++11 and are
removed with C++17
2018-06-21 14:05:09 +02:00
Artem Dinaburg
f39f78c7cc Define constants for _open and silence some warnings 2018-06-20 12:50:50 +02:00
Artem Dinaburg
b54793d232 Windows has the fc utility to compare files instead of diff 2018-06-20 12:50:50 +02:00
Artem Dinaburg
62c3e3cd56 The %p format is implementation defined. Compare it via a special token,
just like the null pointer test.
2018-06-20 12:50:50 +02:00
NeroBurner
364fad5649 port: remove unused includes 2018-06-01 14:50:12 +02:00
NeroBurner
800bd423e4 port: split localtime_r definition and impl 2018-06-01 14:50:12 +02:00
NeroBurner
7450a8b345 mingw-w64: check if localtime_r exists
- check in cmake if localtime_r exists
- if localtime_r is missing (MSVC, mingw-w64 on linux) redefine it using
  localtime_s
2018-06-01 14:50:11 +02:00
NeroBurner
0797f7382b mingw-w64: fix port.h pthread recreation 2018-06-01 14:50:10 +02:00
NeroBurner
d354e2e8f9 mingw-w64: fix dbghelp on case sensitive systems
- fix dbhelp.h include
- fix dbghelp check and link
2018-06-01 14:50:07 +02:00
NeroBurner
06a8ee0976 logging: fix basetsd on case sensitive sytems 2018-06-01 14:50:06 +02:00
Ruslan Baratov
d064ab8d0a Fix build for Android API < 21 2018-04-22 23:54:24 +03:00
Sergiu Deitsch
2f493d292c
Merge pull request #302 from Nazg-Gul/missing-prototype
Resolve missing prototype warning
2018-03-21 13:45:06 +01:00
Sergiu Deitsch
11afec2795
Merge pull request #303 from Nazg-Gul/reincluded-config
Fix redefined warnings from config.h
2018-03-21 13:44:44 +01:00
samuela
838753987f
Make int conversion explicit and fix clang warning 2018-03-20 18:03:46 -07:00
Sergey Sharybin
418f9020e3 Fix redefined warnings from config.h
The issue was caused by config.h header being included from both
header files and implementation files.

Proposed solution is to have regular header guard in the generated
config.h. Benefit of this solution is that it's least intrusive.
Downside is that it only solves issue for CMake build system, and
autoconf one is not fixed since header template is automatically
generated by autoheader who does not add header guard.
2018-03-20 11:14:06 +01:00
Sergey Sharybin
e35bb111c3 konsole family of terminfo supports colored output
Glog was missing colored output when running in terminal
who is set to konsole* TERM, even though the terminal
itself supports colored output.

Add extra terminfo to the check function, so now output
from Glog is properly colored.
2018-03-20 09:49:07 +01:00
Sergiu Deitsch
a97d6b0e1c
Symbolizer support for mingw and cygwin (#208)
* added dbghelp symbolizer support for mingw and cygwin
* fixed compiler errors in case <stdint.h> is not available
* cmake: check whether SymFromAddr actually works
2018-02-27 21:03:20 +01:00
Rodrigo Queiro
3106945d8d Add workaround for Bazel build on macOS
This works around https://github.com/bazelbuild/bazel/issues/3979,
and so closes #282.
2018-01-16 17:06:15 +01:00
Sergiu Deitsch
f3bd836de4
Merge pull request #281 from sergiud/msvc-error-define
Fixed undeclared identifier error
2018-01-02 02:21:51 +01:00
Sergiu Deitsch
85d49f7a47 logging_unittest: fixed undeclared identifier error (fixes #267) 2018-01-02 02:18:00 +01:00
Fumitoshi Ukai
2063b38708
Merge pull request #261 from pcc/fix3
Compute base addresses from program headers while reading /proc/self/maps.
2017-11-10 16:55:27 +09:00
Peter Collingbourne
c4d37a78cc Compute base addresses from program headers while reading /proc/self/maps.
We previously had logic to compute the base address from program
headers as part of symbolization. The problem is that we need a correct
base address earlier in order to adjust a PC into the image's address
space, as these addresses can appear in unsymbolized output.

There was previously an assumption that only the mapping that
was lowest in the address space did not need to be adjusted. This
assumption is not guaranteed (for example, the kernel may choose to
map an ET_DYN lowest) and in fact turned out to be wrong in binaries
linked with lld because the first mapping is read-only.

The solution is to move the program header reading logic into the
code that reads /proc/self/maps.

There is a change in semantics for clients that install a callback
using the InstallSymbolizeOpenObjectFileCallback function. Any such
clients will need to return a correct base address from the callback
by reading program headers using code similar to that in the function
OpenObjectFileContainingPcAndGetStartAddress.
2017-11-08 14:15:02 -08:00
Sergiu Deitsch
bac8811710
Merge pull request #106 from dimhotepus/master
Cache strlen outside of cycles (PVS-Studio)
2017-11-04 16:22:21 +01:00
Kenny Yu
4764ca65f5 Annotate LOG_EVERY_N macros as a benign race for TSAN
Summary:
Issue #80 points out several places in glog where TSAN discovers
false positives. One of these places is in the `LOG_EVERY_N` macros.
These macros are implemented by maintaining a static unprotected
integer counter, and TSAN will report data races on these counters.

Here is a minimum example to reproduce the data race:

```

void logging() {
  for (int i = 0; i < 300; ++i) {
    LOG_EVERY_N(INFO, 2) << "foo";
  }
}

int main() {
  auto t1 = std::thread(logging);
  auto t2 = std::thread(logging);
  t1.join();
  t2.join();
  return 0;
}
```

And here is the TSAN report:

```
WARNING: ThreadSanitizer: data race (pid=776850)
  Write of size 4 at 0x558de483f684 by thread T2:
    #0 logging()
    #1 void std::_Bind_simple<void (*())()>::_M_invoke<>(std::_Index_tuple<>)
    #2 std::_Bind_simple<void (*())()>::operator()()
    #3 std:🧵:_Impl<std::_Bind_simple<void (*())()> >::_M_run()
    #4 execute_native_thread_routine

  Previous write of size 4 at 0x558de483f684 by thread T1:
    #0 logging()
    #1 void std::_Bind_simple<void (*())()>::_M_invoke<>(std::_Index_tuple<>)
    #2 std::_Bind_simple<void (*())()>::operator()()
    #3 std:🧵:_Impl<std::_Bind_simple<void (*())()> >::_M_run()
    #4 execute_native_thread_routine

  Location is global '<null>' at 0x000000000000 (main+0x00000011c684)

  Thread T2 (tid=776857, running) created by main thread at:
    #0 pthread_create
    #1 __gthread_create
    #2 std:🧵:_M_start_thread(std::shared_ptr<std:🧵:_Impl_base>, void (*)())
    #3 main

  Thread T1 (tid=776856, running) created by main thread at:
    #0 pthread_create
    #1 __gthread_create
    #2 std:🧵:_M_start_thread(std::shared_ptr<std:🧵:_Impl_base>, void (*)())
    #3 main

SUMMARY: ThreadSanitizer: data race in logging()
```

To avoid noisy TSAN reports and also avoid adding a performance hit, this
change will mark these counters as benign races so that TSAN will not report
them. This change will only have an effect if we are compiling with TSAN;
there are no changes if we are not building with TSAN.

With this change, the above example no longer reports a data race when built
and run with TSAN.
2017-11-03 17:32:47 -07:00
Fumitoshi Ukai
9f8a9a9a0d Shell escape arguments to /bin/mail. 2017-10-31 13:04:26 +09:00
Shinichiro Hamaji
56b81ea796 Style fixes for consistency 2017-10-20 16:11:31 +09:00
Shinichiro Hamaji
ebf81ac476 Merge pull request #245 from DariuszOstolski/issue211
Fix username lookup in case of missing USER environment variable
2017-10-20 16:09:28 +09:00
Dariusz Ostolski
4912af30f9 #253: Use MS preprocessor idiom to disable warning 2017-10-18 20:56:49 +02:00
Shinichiro Hamaji
d0531421fd Merge pull request #226 from sergiud/zero-allocation-log-failure
Zero allocation fix
2017-10-12 00:25:02 +09:00
Sergiu Deitsch
2fe6508e53 fixed gcc logging failure 2017-10-11 00:45:08 +02:00
Dariusz Ostolski
2d3cf2681d Fix username lookup in case of missing USER environment variable 2017-09-19 22:23:53 +02:00
Shinichiro Hamaji
2a6df66252 Merge pull request #228 from sergiud/dll-export-fix
Fix for missing exports (fixes #227)
2017-08-10 00:06:08 +09:00
Sergiu Deitsch
1bfae38300 added missing exports (fixes #227) 2017-08-09 15:21:32 +02:00
Shinichiro Hamaji
246a5896f1 Merge pull request #225 from jray272/remove-log-every-n-assert
Fix LOG_EVERY_N with clang -Wunused-local-typedef
2017-08-09 16:35:05 +09:00
Jim Ray
dd19fb2466 Remove GOOGLE_GLOG_COMPILE_ASSERT
This compile time assert is no longer used anywhere in glog. Remove
it.
2017-08-09 00:09:16 -07:00
Jim Ray
8b3023f7e4 Fix LOG_EVERY_N with clang -Wunused-local-typedef
Glog uses a pre-C++11 compile time assert to verify the validity of
the severity parameter for LOG_EVERY_N. Unfortunately, some compilers
will complain about the usage of LOG_EVERY_N with
"-Wunused-local-typedef" due to the way the compile time assert is
constructed. This makes it impossible to use LOG_EVERY_N with this
warning treated as an error.

The fix simply removes the assert entirely. This is safe to do since
you can't put anything invalid into the severity parameters without
generating a compile error elsewhere. This has been safe to do ever
since the GLOG_ prefixes were added as part of 6febec361e.

Fixes #223
2017-08-06 00:17:50 -07:00
Jim Ray
8ed1668cdb Update Windows logging.h based on 2df0ca34aa
Commit changes to src/windows/glog/logging.h that were missed in
2df0ca34aa. Because a change to src/glog/logging.h.in was made,
src/windows/preprocess.sh needed to be run.
2017-08-06 00:13:30 -07:00
Shinichiro Hamaji
a808e435b7 Merge pull request #157 from sergiud/cygwin-support
Cygwin support
2017-07-06 15:00:06 +09:00
Shinichiro Hamaji
a835da8e08 Merge pull request #158 from sergiud/zero-allocation
[RFC] reduce heap memory allocations to zero
2017-07-06 14:58:37 +09:00
Shinichiro Hamaji
96f6656551 Merge pull request #145 from pixelb/rate-limit-posix-fadvise
rate limit calls to posix_fadvise()
2017-07-06 14:52:13 +09:00
Hans-Andreas Engel
2df0ca34aa reduce memory allocations to zero 2017-07-06 00:02:38 +02:00
Andrew Schwartzmeyer
d1f49ba5aa Support signal handler on Windows 2017-06-27 10:50:20 -07:00
Andrew Schwartzmeyer
7f95ecfdc7 Link to DbgHelp using pre-processor directive
This method ensure that all users of glog get automatically linked to
the DbgHelp library without needing to set compiler flags.
2017-06-27 10:50:20 -07:00
Andrew Schwartzmeyer
e2caf9876e Export GetStackTrace
Necessary when building with BUILD_SHARED_LIBS=1.
2017-06-27 10:50:20 -07:00
Andrew Schwartzmeyer
f1d64f7deb Support symbolizer and demangler on Windows 2017-06-27 10:50:20 -07:00
Andrew Schwartzmeyer
e5d36443c6 Support stacktrace on Windows 2017-06-26 18:47:34 -07:00
Andrew Schwartzmeyer
9c1d0e6f6e Copy stacktrace_generic-inl.h for Windows 2017-06-26 16:21:10 -07:00
Shinichiro Hamaji
a6266db97a Add a hack for naive include scanners 2017-05-09 17:35:18 +09:00
Shinichiro Hamaji
ee9d487782 Define OS_LINUX only if it's not defined yet 2017-05-09 17:22:38 +09:00
Shinichiro Hamaji
c4814b729a symbolize: Allow 4kB stack consumption on PPC64 2017-05-09 17:21:16 +09:00
Shinichiro Hamaji
f278d734c1 x86 stacktrace: Use __builtin_frame_address if possible 2017-05-09 17:14:15 +09:00
Shinichiro Hamaji
0d78884a22 Relax test for symbolize
Don't rely on an internal-linkage extern "C" function having an
unmangled name. This isn't required by the ABI, and in fact is not
valid for a conforming compiler(!). Instead, allow symbolization to
produce either a mangled or an unmangled name here.
2017-05-09 17:14:15 +09:00
Shinichiro Hamaji
7314fa3f86 Use LOG(FATAL) instead of CHECK(false) 2017-05-09 17:14:12 +09:00
Shinichiro Hamaji
f012836db1 Run src/windows/preprocess.sh 2017-05-09 16:41:58 +09:00
Ning Ren
0d8c6340f8 CHECK_NOTNULL works with smart pointers when compiled in C++11. 2017-04-20 15:32:24 -07:00
mayah
8fa778aa12 Add __declspec(noreturn) on Win
Currently cl.exe doesn't know LOG(FATAL) exits the program. Set
__declspec(noreturn).
2017-03-07 11:22:24 +09:00
Yoshisato Yanagisawa
027332ffac DCHECK_ALWAYS_ON to make D* enabled under NDEBUG
The macro NDEBUG could be automatically defined for release build on
some build environments (e.g. MSVC).  If we use NDEBUG as a key to
distinguish using DCHECK as CHECK (I call this DCHECK is enabled) or
not, we cannot make DCHECK enabled for release build on such
environments.

Considering people use a program with glog for presubmit testing or
dogfooding, they should need to do release build with DCHECK enabled.
2017-02-08 17:23:37 +09:00
Mike Percy
f581614a78 Use thread local for libunwind GetStackTrace()
Previously, the implementation of google::GetStackTrace() that uses
libunwind uses a global variable that enforces that only one thread may
invoke libunwind at a time. However, libunwind is thread-safe. The
comment above the variable indicates that it is to protect against
reentrancy issues.

Instead of using a global variable, it would be much better to use a
thread-local variable to protect against these reentrancy issues. That
should provide the needed reentrancy protection while allowing multiple
threads to get stack traces at the same time.

It also allows for the removal of the atomic CAS operations on the
variable.

Resolves #160.
2017-01-27 21:24:11 -08:00
Sergiu Deitsch
96a09ae01a fixed cygwin compilation errors 2017-01-17 12:47:11 +01:00
Pádraig Brady
dacd296796 rate limit calls to posix_fadvise()
There can be a large kernel overhead involved in POSIX_FADV_DONTNEED.
There is no point in calling this per item logged, so rate limit
to at most once per 2MiB written.

With a simple test program that logs 100K items at WARNING level:

Before:

  $ time strace -c -e fadvise64 log.test \
    -log_dir=/dev/shm -logtofiles=true -logtostderr=false
  % time     seconds  usecs/call     calls    errors syscall
  ------ ----------- ----------- --------- --------- ----------------
  100.00   12.522509         125     99957           fadvise64
  ------ ----------- ----------- --------- --------- ----------------
  real    0m52.671s
  user    0m2.194s
  sys     0m44.022s

After:

  $ time strace -c -e fadvise64 log.test \
    -log_dir=/dev/shm -logtofiles=true -logtostderr=false

  % time     seconds  usecs/call     calls    errors syscall
  ------ ----------- ----------- --------- --------- ----------------
  100.00    0.000759         152         5           fadvise64
  ------ ----------- ----------- --------- --------- ----------------
  real    0m4.206s
  user    0m1.436s
  sys     0m3.153s

Fixes issue #84
2016-12-09 19:45:34 +00:00
Fumitoshi Ukai
cf36dabd8e Merge pull request #127 from MinGW-caffe/master
try to avoid the error "conflicting declaration 'typedef DWORD pthread_t'" etc. in MinGW
2016-10-19 16:29:34 +09:00
Fumitoshi Ukai
bf766fac4f Merge pull request #123 from yying/master
Set sinks_ to NULL after deletion in LogDestination::DeleteLogDestinations
2016-10-19 16:10:39 +09:00
Fumitoshi Ukai
7cff62028c Merge pull request #116 from pcc/fix2
Fix autotools build.
2016-10-19 16:06:38 +09:00
MiniLight
9c584dd2ed try to avoid the error "conflicting declaration 'typedef DWORD
pthread_t'" etc.
2016-10-03 08:00:09 +08:00
Andy Ying
a00dfdfc53 NULL sinks_ after deletion to prevent dangling pointer 2016-09-11 01:16:32 -04:00
Ezequiel Lara Gomez
47af307fa6 Added fixed log name support
See https://code.google.com/p/google-glog/issues/detail?id=209 - this is an updated version of that patch.

It adds a flag that allows to switch behavior from base_filename + filename_extension + time_pid_string to base_filename + filename_extension, while still defaulting to the current behavior to avoid breakage in existing code. This change would allow easier log rotation schemes and better control on what's written on disk.
2016-09-08 10:52:39 +01:00
Peter Collingbourne
8e98eb2a5a Fix autotools build.
It looks like commit 3c49b93 modified the auto-generated file src/config.h.in
to add a definition of macro GOOGLE_GLOG_DLL_DECL. One of the autotools
reverts this change upon running "make", causing the build to fail when a
source file includes demangle.h.

To fix the problem, revert the change to src/config.h.in and include
glog/logging.h from demangle.h which provides a definition of that macro.
2016-06-22 18:48:32 -07:00
Peter Collingbourne
a93a4511ec symbolize: Calculate a module's zero VA using program headers.
Previously we were using a module's "start address", i.e. the
address at which the module's executable region was mapped, as the
zero virtual address, i.e. the address from which the DSO's virtual
addresses are calculated. This works fine for DSOs created by the
bfd and gold linkers, which will emit a PT_LOAD directive into the
program header which loads the executable region at virtual address
(p_vaddr) and file offset (p_offset) 0.

However, the lld linker may place a read-only region before the
executable region, meaning that both p_vaddr and p_offset for the
executable region are non-zero. This means that any symbols resolved
by the symbolizer are resolved to an incorrect virtual address. To
correctly calculate the address corresponding to virtual address zero,
we need to take into account p_vaddr and p_offset.

Specifically, the calculation starts with the "base address", i.e. the
start address minus the file offset. To get from the base address to
virtual address zero, we first add p_offset. This gives us the mapped
address of the start of the segment, or in other words the mapped
address corresponding to the virtual address of the segment. (Note
that this is distinct from the start address, as p_offset is not
guaranteed to be page aligned.) We then subtract p_vaddr, which takes
us to virtual address zero.
2016-06-22 18:41:43 -07:00
dimhotepus
4544e968ab Cache strlen outside of cycles (PVS-Studio) 2016-04-30 14:24:12 +03:00
Fumitoshi Ukai
de6149ef8e Merge pull request #101 from yasushi-saito/master
Allow permission line in /proc/self/map to be "rwx", not just "r-x".
2016-04-15 17:05:30 +09:00
Fumitoshi Ukai
202b395c04 Merge pull request #91 from abdasgupta/master
Added support for PowerPC.
2016-04-13 14:00:49 +09:00
Yaz Saito on W541
d630221933 Allow permission line in /proc/self/map to be "rwx", not just "r-x". At
least in Ubuntu14, a binary file that's writable by the process owner
has permission "rwx", not "r-x".
2016-04-11 14:35:42 -07:00
mayah
821d3e806e Run src/windows/preprocess.sh
src/windows/glog/logging.h is not generated by the current source.
Let me run src/windows/preprocess.sh and update the source.
2016-03-31 17:29:36 +09:00
Abhishek Dasgupta
b27d0420fb Added support for PowerPC. 2016-03-21 11:28:53 +00:00
Sergey Sharybin
f94a49c571 Resolve missing prototype warning
Makes compilation process less noisy even when using string compiler flags.
2015-12-31 17:55:37 +05:00
Fumitoshi Ukai
4d391fe692 use namespace GFLAGS_NAMESPACE instead namespace gflags
only signalhandler_unittest.cc uses "using namespace gflags".
others use "using namespace GFLAGS_NAMESPACE", so
signalhandler_unittest.cc does the same way.

fixes #62
2015-12-17 16:31:55 +09:00
Fumitoshi Ukai
a63f466c48 win: use _fdopen instead of fdopen
The POSIX function fdopen is deprecated.
Use the ISO C++ conformant _fdopen instead.
https://msdn.microsoft.com/library/ms235351.aspx

fixes #73
2015-12-17 15:40:25 +09:00
Fumitoshi Ukai
1256d28554 win: FAILED macro can't be used with HANDLE.
FAILED macro is for HRESULT, not for HANDLE.
FindFirstFile returns INVALID_HANDLE_VALUE when error or not found.
https://msdn.microsoft.com/library/windows/desktop/aa364418(v=vs.85).aspx

fixes #79
2015-12-17 15:36:40 +09:00
Fumitoshi Ukai
0312301143 avoid calling new/malloc in signalhandler.
FlushLogFilesUnsafe would be called in FailureSignalHandler,
so should avoid calling new/malloc, which are not signal safe.

fixes #78
2015-12-17 15:26:15 +09:00
Yoshisato Yanagisawa
cda16b3443 Reset SIGABRT action only if FailureSignalHandler is installed.
When I set my own signal handler to SIGABRT, it did not executed
with CHECK.  That is because SIGABRT handler is reset to default
just before glog calls abort.
Let me make it reset only if the handler is what glog installed
i.e. FailureSignalHandler.
2015-11-26 16:19:22 +09:00
Robert Hencke
c10e6ec19c Fix double-free in unit test on Windows.
The LOG_SYSRESULT refers to result twice.  Since, in this test,
result expands to FindClose(handle), the handle was being freed twice.
2015-09-06 09:53:22 -04:00
Fumitoshi Ukai
85e5c6edad Merge pull request #47 from sergiud/master
Allow to disable multithreading support using CMake
2015-08-12 16:09:02 +09:00
Fumitoshi Ukai
a94afc6807 Merge pull request #26 from theopolis/feature-mode-flag
[#23] Add logfile_mode to control logfile permissions
2015-08-12 16:05:28 +09:00
Teddy Reed
58438d398f [#23] Add logfile_mode to control logfile permissions 2015-08-10 16:49:33 -07:00
Sergiu Dotenco
cb5487d901 cmake: allow to disable multithreading support
This commit additionally enables threading for win32 by default.
2015-08-08 21:26:17 +02:00
Fumitoshi Ukai
f7691955e8 Merge pull request #35 from bsilver8192/fix-mocklog-unused-arguments
Fix mocklog unused arguments
2015-08-06 17:17:55 +09:00
Fumitoshi Ukai
254db0ae1b Merge pull request #34 from bsilver8192/fix-macro-redefinition
Fix redefinition of _XOPEN_SOURCE.
2015-08-06 17:15:44 +09:00
Fumitoshi Ukai
cd37eec302 Merge pull request #20 from UbimoLTD/patch-1
Don't call RAW_VLOG with locking vmodule_lock

SetVLOGLevel locks vmodule_lock however RAW_VLOG at the end also implicitly locks it via InitVLOG3__.
This causes deadlock/segfault.

fixes #29
2015-08-06 17:09:02 +09:00
Fumitoshi Ukai
8db3ff0b75 Merge pull request #12 from ukai/fix_leak
delete LogDestination::sinks_ at DeleteLogDestinations(). 

fixes #8
2015-08-06 16:57:51 +09:00
Fumitoshi Ukai
fe136448ff Merge pull request #7 from sergiud/master
Add CMake support. closes #4
2015-08-06 16:53:55 +09:00
Sergiu Dotenco
5aee7c7899 added missing include 2015-07-15 22:35:00 +02:00
Sergiu Dotenco
856ff81a82 fixed vc 14.0 ctp 6 compilation error 2015-07-15 22:34:59 +02:00
Sergiu Dotenco
b561c94b19 determine gflags namespace automatically 2015-07-15 22:34:59 +02:00
Sergiu Dotenco
f9def39a46 do not redefine snprintf if it's already available 2015-07-15 22:34:58 +02:00
Sergiu Dotenco
fa4c5b50a9 do not redefine stl logging macros 2015-07-15 22:34:58 +02:00
Sergiu Dotenco
ea628ae809 allow to define TEST_SRC_DIR as a macro 2015-07-15 22:34:58 +02:00
Sergiu Dotenco
3325258036 allow to use __declspec(noreturn) 2015-07-15 22:34:57 +02:00
Sergiu Dotenco
3d9fea9e84 export the Demangle function 2015-07-15 22:34:57 +02:00
Sergiu Dotenco
3c49b93201 added cmake support 2015-07-15 22:34:44 +02:00
Brian Silverman
beb55fa825 Fix redefinition of _XOPEN_SOURCE.
Under Debian Jessie, I get a warning about redefining _XOPEN_SOURCE
which is easy to fix.
2015-06-16 16:50:57 -07:00
Brian Silverman
180eaff781 Fix unused arguments warning in ScopedMockLog. 2015-06-16 16:50:01 -07:00
romange
2c5038470b Update vlog_is_on.cc
SetVLOGLevel locks vmodule_lock however RAW_VLOG at the end also implicitly locks it via InitVLOG3__.

This causes deadlock/segfault.
2015-04-30 20:28:32 +03:00
Fumitoshi Ukai
ed072a55b8 don't remove sinks_ elements. 2015-04-11 00:05:05 +09:00
Abhishek Parmar
701dd7120d Guard GOOGLE_PREDICT_TRUE|FALS with #ifndef to avoid collision with other google opensource projects like protobuf. 2015-04-08 10:19:06 -07:00
Fumitoshi Ukai
9c2acaaa49 delete LogDestination::sinks_ at DeleteLogDestinations().
fixes #8 AddLogSink memory leak
2015-03-27 17:23:20 +09:00
Fumitoshi Ukai
1b0b08c8dd Merge pull request #10 from jmr/std_vector
LOG_STRING: use std::vector and std::string.
2015-03-27 16:43:58 +09:00
Jesse Rosenstock
162a8ef4ea LOG_STRING: use std::vector and std::string.
Previously, plain vector and string were used.
This assumed that there were "using" directives or
declarations before the macro was used.  This will
not always be the case.
2015-03-26 14:25:14 -04:00
Michael Tanner
66088e4787 Adds color output support for tmux terminals 2015-03-23 10:56:04 +00:00
tbennun
7553b4193d Fix x64/Debug build on MSVS 2015-03-13 07:56:59 +02:00
78da3bf8fe Fixes for the latest MSVS.
- ssize_t
Since Windows does not have ssize_t, we need to include BaseTsd.h and
use SSIZE_t instead.

- include algorithm
MSVS 2013 requests developers to include algorithm when they use
std::min.

By yyanagisawa



git-svn-id: https://google-glog.googlecode.com/svn/trunk@143 eb4d4688-79bd-11dd-afb4-1d65580434c0
2014-08-19 00:36:29 +00:00
09e8dd6289 Add libc++ support
Similar patch was provided in
    
https://code.google.com/p/google-glog/issues/detail?id=121


git-svn-id: https://google-glog.googlecode.com/svn/trunk@142 eb4d4688-79bd-11dd-afb4-1d65580434c0
2014-03-05 05:20:24 +00:00
a5ffa88413 Build issues in demangle.cc
git-svn-id: https://google-glog.googlecode.com/svn/trunk@141 eb4d4688-79bd-11dd-afb4-1d65580434c0
2014-03-02 01:37:08 +00:00
8367470aa5 Adding a callback mechanism to allow users of google.glog to provide
their own implementation of  OpenObjectFileContainingPcAndGetStartAddress.

GTTF: Make stack trace symbolization code recognize more symbols.
One example is __libc_start_main (easy to check), there may be more.

Include the correct elf header on OpenBSD and Android.

Fix Coverity NO_EFFECT defect. Comparing unsigned greater than or equal zero is always true.



git-svn-id: https://google-glog.googlecode.com/svn/trunk@140 eb4d4688-79bd-11dd-afb4-1d65580434c0
2014-03-01 00:33:41 +00:00
a0073e504b Add StrError and replace posix_strerror_r calls
For now, we do not remove the declaration of posix_strerror_r,
but we might remove it in future.


git-svn-id: https://google-glog.googlecode.com/svn/trunk@139 eb4d4688-79bd-11dd-afb4-1d65580434c0
2013-10-31 05:39:43 +00:00
0242c8e94d Fix VC build by adding GOOGLE_GLOG_DLL_DECL
git-svn-id: https://google-glog.googlecode.com/svn/trunk@138 eb4d4688-79bd-11dd-afb4-1d65580434c0
2013-10-31 05:36:25 +00:00
a0bf19d0df A style fix for C++11
This patch is given by Nico (thanks!)



git-svn-id: https://google-glog.googlecode.com/svn/trunk@137 eb4d4688-79bd-11dd-afb4-1d65580434c0
2013-07-29 06:27:17 +00:00
1518f230c6 Reduce dynamic allocation from 3 to 1 per log message
This patch was contributed in

https://code.google.com/p/google-glog/issues/detail?id=131

by engel. Thanks!


git-svn-id: https://google-glog.googlecode.com/svn/trunk@136 eb4d4688-79bd-11dd-afb4-1d65580434c0
2013-05-29 14:10:49 +00:00
478a80caa0 Attempt to improve mingw-w64 support
- Set -Isrc/windows for mingw
- Check existence of sigaction, pread, and pwrite
- Provide alternative implementation of pread and pwrite
- Eliminate symlink code for OS_WINDOWS
- Don't check /proc/self/fd if the OS isn't linux
- Don't use MSVC specific declarations in port.h for mingw



git-svn-id: https://google-glog.googlecode.com/svn/trunk@135 eb4d4688-79bd-11dd-afb4-1d65580434c0
2013-02-18 10:56:53 +00:00
a106e61178 Support unordered_(map|set) by stl_logging
git-svn-id: https://google-glog.googlecode.com/svn/trunk@134 eb4d4688-79bd-11dd-afb4-1d65580434c0
2013-02-18 10:45:46 +00:00
069ee58a09 Fix Mac test failure
We need only the first line from signalhandler.out3


git-svn-id: https://google-glog.googlecode.com/svn/trunk@131 eb4d4688-79bd-11dd-afb4-1d65580434c0
2013-02-01 05:46:37 +00:00
e6af5ea5f1 Make sure stderr is not buffered.
git-svn-id: https://google-glog.googlecode.com/svn/trunk@130 eb4d4688-79bd-11dd-afb4-1d65580434c0
2013-01-31 04:39:54 +00:00
fdc710e355 Add dllimport and dllexport for new symbols
git-svn-id: https://google-glog.googlecode.com/svn/trunk@129 eb4d4688-79bd-11dd-afb4-1d65580434c0
2013-01-31 03:49:40 +00:00
35ba669307 Revert http://code.google.com/p/google-glog/source/detail?r=127
Casting to (void) was bad because the return value of DCHECK_NOTNULL
cannot be used.



git-svn-id: https://google-glog.googlecode.com/svn/trunk@128 eb4d4688-79bd-11dd-afb4-1d65580434c0
2013-01-31 03:48:24 +00:00
3297f04c13 Remove warning of DCHECK_NOTNULL
http://code.google.com/p/google-glog/issues/detail?id=87


git-svn-id: https://google-glog.googlecode.com/svn/trunk@127 eb4d4688-79bd-11dd-afb4-1d65580434c0
2013-01-25 07:59:25 +00:00
c4c25e85fd Make glog ABI compatible with gflags
The ABI incompatibility is bad when 

- Build glog without gflags (glog package in most distributions doesn't 
  depend on gflags) 
- Use both glog and gflags 


git-svn-id: https://google-glog.googlecode.com/svn/trunk@125 eb4d4688-79bd-11dd-afb4-1d65580434c0
2013-01-25 05:44:43 +00:00
3b59339f08 Follow up for the color log patch
- Rename colorstderr => colorlogtostderr
- Remove duplicated code
- Set colorlogtostderr=0 in the unittest



git-svn-id: https://google-glog.googlecode.com/svn/trunk@124 eb4d4688-79bd-11dd-afb4-1d65580434c0
2013-01-23 05:27:13 +00:00