Commit Graph

199 Commits

Author SHA1 Message Date
9495564423 Call glog_internal_namespace_::ProgramInvocationShortName() explicitly.
Otherwise, we may call google::ProgramInvocationShortName() in gflags.


git-svn-id: https://google-glog.googlecode.com/svn/trunk@68 eb4d4688-79bd-11dd-afb4-1d65580434c0
2009-07-30 10:43:50 +00:00
5bf76bb4d5 Avoid warning for type punning like
src/logging_unittest.cc:591: warning: dereferencing type-punned pointer will break strict-aliasing rules

As we'll never dereference the casted pointers, it's OK to silence this warning.


git-svn-id: https://google-glog.googlecode.com/svn/trunk@67 eb4d4688-79bd-11dd-afb4-1d65580434c0
2009-07-30 10:42:59 +00:00
fcbeeb9f35 Fix posix_strerror_r for OpenBSD.
git-svn-id: https://google-glog.googlecode.com/svn/trunk@66 eb4d4688-79bd-11dd-afb4-1d65580434c0
2009-07-30 05:51:28 +00:00
f028227fa3 Define DumpPCAndSymbol() only when HAVE_SYMBOLIZE is defined.
git-svn-id: https://google-glog.googlecode.com/svn/trunk@65 eb4d4688-79bd-11dd-afb4-1d65580434c0
2009-07-29 09:11:48 +00:00
d712e2084a Fix user name detection for Windows.
This patch was given by ademin (thanks!).

http://code.google.com/p/google-glog/issues/detail?id=12


git-svn-id: https://google-glog.googlecode.com/svn/trunk@64 eb4d4688-79bd-11dd-afb4-1d65580434c0
2009-07-29 08:38:20 +00:00
fc88a722eb Suppress warnings.
git-svn-id: https://google-glog.googlecode.com/svn/trunk@63 eb4d4688-79bd-11dd-afb4-1d65580434c0
2009-07-29 08:37:32 +00:00
b35305f1ab Initializes the length of machine name properly.
This fix was suggested at (thanks!)

http://code.google.com/p/google-glog/issues/detail?id=9


git-svn-id: https://google-glog.googlecode.com/svn/trunk@62 eb4d4688-79bd-11dd-afb4-1d65580434c0
2009-07-29 07:34:28 +00:00
2c28a49394 Regression: Add NOGDI and NOMINMAX macros before including windows.h.
git-svn-id: https://google-glog.googlecode.com/svn/trunk@61 eb4d4688-79bd-11dd-afb4-1d65580434c0
2009-07-27 08:13:30 +00:00
c24b607748 Use internal namespace instead of anonymous namespace for Mutex.
git-svn-id: https://google-glog.googlecode.com/svn/trunk@60 eb4d4688-79bd-11dd-afb4-1d65580434c0
2009-07-27 05:42:23 +00:00
70cb94e244 Add cast for pthread_self() to avoid warning.
git-svn-id: https://google-glog.googlecode.com/svn/trunk@59 eb4d4688-79bd-11dd-afb4-1d65580434c0
2009-07-27 05:31:23 +00:00
d96287aa28 Add virtual ~Thread() to avoid warnings.
git-svn-id: https://google-glog.googlecode.com/svn/trunk@58 eb4d4688-79bd-11dd-afb4-1d65580434c0
2009-07-27 05:30:39 +00:00
ac63dd1f58 Add OS_NETBSD macro.
git-svn-id: https://google-glog.googlecode.com/svn/trunk@57 eb4d4688-79bd-11dd-afb4-1d65580434c0
2009-07-27 05:29:58 +00:00
8c4e3a9238 Suppress warnings. Most of this patch was given by keir (thanks!).
Corresponding glog bug: http://code.google.com/p/google-glog/issues/detail?id=10

The differences from keir's patch are:
- For raw_logging.h.in, I just included time.h for struct tm.
- Added a fprintf which warns that we should have died to avoid a warning for unused local variable.
- Added inline for some functions which may be unused in googletest.h.
- Removed DumpPCAndFrameSize as it was unused.


git-svn-id: https://google-glog.googlecode.com/svn/trunk@56 eb4d4688-79bd-11dd-afb4-1d65580434c0
2009-07-08 17:19:09 +00:00
5f9c97a33c Run benchmarks only when --run_benchmark is specified.
git-svn-id: https://google-glog.googlecode.com/svn/trunk@52 eb4d4688-79bd-11dd-afb4-1d65580434c0
2009-07-07 03:10:39 +00:00
c1995cd469 Encapsulate the definition of Mutex into glog's internal namespace.
This will fix the issue a user in Japan reported in his blog.

http://kzk9.net/blog/2009/05/deadlock_with_gflags_and_glog_2.html

According to his description, when he use glog and gflags-1.1, gflags'
code uses glog's Mutex, the Mutex cannot lock the pthread_mutex, and
the program stops.

The bug happens with the combination of gflags-1.1 and glog. It seems
that the issue was caused by incompatibility of Mutex classes. Though I
couldn't reproduce this issue, the reporter of this bug said that
adding namespace fixes the problem and I think it is generally good
idea to use namespace for this kind of common component to avoid
incompatibilities. So, I check this change in now. This patch
will protect glog from future changes on Mutex as well.
--This line, and  those below, will be ignored--

M    src/base/mutex.h


git-svn-id: https://google-glog.googlecode.com/svn/trunk@51 eb4d4688-79bd-11dd-afb4-1d65580434c0
2009-05-20 05:55:40 +00:00
7b97abb978 Suppress warnings (re-definition of _XOPEN_SOURCE) by including utilities.h first.
git-svn-id: https://google-glog.googlecode.com/svn/trunk@50 eb4d4688-79bd-11dd-afb4-1d65580434c0
2009-05-19 09:12:00 +00:00
a86eb1ac62 Check if InitGoogleLogging is not called twice.
git-svn-id: https://google-glog.googlecode.com/svn/trunk@47 eb4d4688-79bd-11dd-afb4-1d65580434c0
2009-04-10 16:15:53 +00:00
ddfd1884b6 A bug fix for Windows: Use GetSystemTimeAsFileTime instead of GetSystemTime. SYSTEMTIME's mSecond is not a unix time but like tm.tm_sec.
git-svn-id: https://google-glog.googlecode.com/svn/trunk@45 eb4d4688-79bd-11dd-afb4-1d65580434c0
2009-04-09 07:49:44 +00:00
8cf64cc167 Use struct instead of class for forward declaration of CrashReason as we define it as struct.
git-svn-id: https://google-glog.googlecode.com/svn/trunk@44 eb4d4688-79bd-11dd-afb4-1d65580434c0
2009-04-07 09:03:16 +00:00
315d590cdc Apply patch given by maw (thanks!). The patch was modified a bit using AC_ARG_WITH.
- Fix build problems when building with gtest.
- --with-gflags support.


git-svn-id: https://google-glog.googlecode.com/svn/trunk@42 eb4d4688-79bd-11dd-afb4-1d65580434c0
2009-04-07 06:33:09 +00:00
b86afef3f7 Fixes for GCC 4.4. Thanks John for this patch!
git-svn-id: https://google-glog.googlecode.com/svn/trunk@41 eb4d4688-79bd-11dd-afb4-1d65580434c0
2009-03-10 02:15:40 +00:00
4a3f102ce0 Introduce RecordCrashReason().
git-svn-id: https://google-glog.googlecode.com/svn/trunk@40 eb4d4688-79bd-11dd-afb4-1d65580434c0
2009-03-04 10:16:33 +00:00
f365379532 Add license information for all source code.
git-svn-id: https://google-glog.googlecode.com/svn/trunk@39 eb4d4688-79bd-11dd-afb4-1d65580434c0
2009-01-28 17:04:50 +00:00
e70803833d Bug fix: ifdef guard for InitGoogleMock must be HAVE_LIB_GMOCK rather than HAVE_LIB_GTEST.
git-svn-id: https://google-glog.googlecode.com/svn/trunk@38 eb4d4688-79bd-11dd-afb4-1d65580434c0
2009-01-24 19:25:56 +00:00
8ef5cd3398 Regenerate header files for VC++.
git-svn-id: https://google-glog.googlecode.com/svn/trunk@34 eb4d4688-79bd-11dd-afb4-1d65580434c0
2009-01-23 19:00:09 +00:00
0c6fdbd87f Remove the name of unused parameter.
git-svn-id: https://google-glog.googlecode.com/svn/trunk@32 eb4d4688-79bd-11dd-afb4-1d65580434c0
2009-01-23 18:49:53 +00:00
630e77bac0 Remove unnecessary #include.
git-svn-id: https://google-glog.googlecode.com/svn/trunk@31 eb4d4688-79bd-11dd-afb4-1d65580434c0
2009-01-23 18:48:11 +00:00
c3441fb6ba Better Cygwin support.
- configure.ac: Add -lpthread only if acx_pthread_ok is yes. In cygwin, we use Windows' thread so that we don't need -lpthread.
- base/mutex.h: Define NOMINMAX before we include windows.h.
- glog/*.h: Make sure that dllimport doesn't appear in cygwin. Note that windows.h may define _WIN32 macro.
- utilities.h: Define OS_CYGWIN.


git-svn-id: https://google-glog.googlecode.com/svn/trunk@30 eb4d4688-79bd-11dd-afb4-1d65580434c0
2009-01-22 18:22:48 +00:00
e31a91b650 * Add LOG_TO_STRING.
* Add LOG_AT_LEVEL.
* Add DVLOG.
* Add LOG_TO_SINK_ONLY.
* Log microseconds.
* Add --log_backtrace_at option.
* Introduce CrashReason class.
* Fix some bugs.


git-svn-id: https://google-glog.googlecode.com/svn/trunk@29 eb4d4688-79bd-11dd-afb4-1d65580434c0
2009-01-15 10:34:35 +00:00
eecffc5aa5 Introduce mock-log.h for unittests.
git-svn-id: https://google-glog.googlecode.com/svn/trunk@28 eb4d4688-79bd-11dd-afb4-1d65580434c0
2009-01-13 11:49:10 +00:00
9de1077eed Define ARRAYSIZE in utilities.h and use it.
git-svn-id: https://google-glog.googlecode.com/svn/trunk@27 eb4d4688-79bd-11dd-afb4-1d65580434c0
2009-01-09 06:07:55 +00:00
cc27d6aa59 Use gtest and gmock if installed.
git-svn-id: https://google-glog.googlecode.com/svn/trunk@26 eb4d4688-79bd-11dd-afb4-1d65580434c0
2009-01-05 06:05:01 +00:00
68e9555c91 Initialize gflags in signalhandler_unittest.
git-svn-id: https://google-glog.googlecode.com/svn/trunk@25 eb4d4688-79bd-11dd-afb4-1d65580434c0
2009-01-05 05:56:05 +00:00
6dfafc4571 Fix a typo in commandlineflags.h.
git-svn-id: https://google-glog.googlecode.com/svn/trunk@24 eb4d4688-79bd-11dd-afb4-1d65580434c0
2009-01-05 05:54:57 +00:00
afd586a5d5 Initial windows support. Now we don't have the stacktrace and several unittests.
git-svn-id: https://google-glog.googlecode.com/svn/trunk@23 eb4d4688-79bd-11dd-afb4-1d65580434c0
2008-12-19 15:20:40 +00:00
c54c735616 Flush logs unsafely before program fails in the signal handler.
git-svn-id: https://google-glog.googlecode.com/svn/trunk@22 eb4d4688-79bd-11dd-afb4-1d65580434c0
2008-12-19 06:49:33 +00:00
4f81d0f209 Add -lpthread in addition to -pthread on Linux.
git-svn-id: https://google-glog.googlecode.com/svn/trunk@21 eb4d4688-79bd-11dd-afb4-1d65580434c0
2008-11-21 11:22:51 +00:00
a00ca9b038 Fix a typo: s/gnore/ignore/
git-svn-id: https://google-glog.googlecode.com/svn/trunk@18 eb4d4688-79bd-11dd-afb4-1d65580434c0
2008-11-17 10:38:58 +00:00
32b7e7c1a4 Remove stacktrace.cc.
git-svn-id: https://google-glog.googlecode.com/svn/trunk@17 eb4d4688-79bd-11dd-afb4-1d65580434c0
2008-11-17 08:32:28 +00:00
f9b58c5198 Re-organize the way to produce stacktrace.
Since we introduced the API to set signal handler and print a
stacktrace, we should avoid glibc's backtrace, which may call malloc.
Basically, we choose the way to produce a stacktrace as same as
perftools.

Also, I removed GetStackFrames, which is not used and not implemented
with glibc.


git-svn-id: https://google-glog.googlecode.com/svn/trunk@16 eb4d4688-79bd-11dd-afb4-1d65580434c0
2008-11-17 07:58:10 +00:00
1ea4ad6ba1 Use uintptr_t instead of int as the integer format of pthread_t.
git-svn-id: https://google-glog.googlecode.com/svn/trunk@14 eb4d4688-79bd-11dd-afb4-1d65580434c0
2008-11-04 07:08:11 +00:00
d15fcf784c Stop to define DISALLOW_EVIL_CONSTRUCTORS to avoid name conflict.
git-svn-id: https://google-glog.googlecode.com/svn/trunk@13 eb4d4688-79bd-11dd-afb4-1d65580434c0
2008-11-03 05:00:04 +00:00
198a6d51b2 Forgot to add file for the previous change...
Add InstallFailureSignalHandler().  The function installs a signal handler that will dump useful information when the program crashes on certain signals such as SIGSEGV.


git-svn-id: https://google-glog.googlecode.com/svn/trunk@12 eb4d4688-79bd-11dd-afb4-1d65580434c0
2008-10-30 10:38:57 +00:00
91d9fd8814 Add InstallFailureSignalHandler(). The function installs a signal handler that
will dump useful information when the program crashes on certain signals such
as SIGSEGV.
Also, changed the version of autoconf (2.59 => 2.61).


git-svn-id: https://google-glog.googlecode.com/svn/trunk@11 eb4d4688-79bd-11dd-afb4-1d65580434c0
2008-10-30 10:33:45 +00:00
c481ede8ce Use abort instead of exit.
git-svn-id: https://google-glog.googlecode.com/svn/trunk@9 eb4d4688-79bd-11dd-afb4-1d65580434c0
2008-10-17 11:54:23 +00:00
2ed196e07a Fix a bug: vmodule didn't work with gflags. Since
gflags isn't initialized when REGISTER_MODULE_INITIALIZER is invoked,
we couldn't initialize vmodule_list properly. Modified to call
VLOG2Initializer in the first call of InitVLOG3__.


git-svn-id: https://google-glog.googlecode.com/svn/trunk@8 eb4d4688-79bd-11dd-afb4-1d65580434c0
2008-10-17 11:53:23 +00:00
364832195d Use dladdr to get symbols for environments which doesn't use ELF and
has execinfo.h (e.g., MacOSX 10.5). Though dladdr may not be async
signal safe, it's OK since glog's stacktrace doesn't depend on signals.


git-svn-id: https://google-glog.googlecode.com/svn/trunk@7 eb4d4688-79bd-11dd-afb4-1d65580434c0
2008-10-17 11:52:32 +00:00
e1fb8f60e9 Add __attribute__((noinline)) for StackGrowsDown. This is necessary for recent GCC (4.3).
git-svn-id: https://google-glog.googlecode.com/svn/trunk@6 eb4d4688-79bd-11dd-afb4-1d65580434c0
2008-10-14 00:32:16 +00:00
b8b4db46fe glog 0.1
git-svn-id: https://google-glog.googlecode.com/svn/trunk@2 eb4d4688-79bd-11dd-afb4-1d65580434c0
2008-10-07 05:43:05 +00:00