Commit Graph

826 Commits

Author SHA1 Message Date
cb35010215 Use GLOG_* environment variables even when gflags is installed.
Define GLOG_DEFINE_*, which checks if the GLOG_* environment variable
is defined. If defined, GLOG_DEFINE_* passes the value and otherwise,
it passes the original default value. In this way, GLOG_DEFINE_* macro
uses the value specified by gflags first, then GLOG_* environment
variables, and finally it uses the default value if neither of them are
specified.


git-svn-id: https://google-glog.googlecode.com/svn/trunk@76 eb4d4688-79bd-11dd-afb4-1d65580434c0
2010-01-20 07:39:18 +00:00
327359662c Handle ucontext.h properly in Snow leopard.
git-svn-id: https://google-glog.googlecode.com/svn/trunk@75 eb4d4688-79bd-11dd-afb4-1d65580434c0
2010-01-18 06:15:33 +00:00
b71aa94381 Fix compilation error with -DNDEBUG.
This bug is reported in
http://code.google.com/p/google-glog/issues/detail?id=19



git-svn-id: https://google-glog.googlecode.com/svn/trunk@74 eb4d4688-79bd-11dd-afb4-1d65580434c0
2009-11-11 09:07:47 +00:00
effef71e00 Use numeric_limits instead of SSIZE_MAX.
It seems a version of arm-linux-gcc doesn't have this symbol.
http://code.google.com/p/google-glog/issues/detail?id=18



git-svn-id: https://google-glog.googlecode.com/svn/trunk@73 eb4d4688-79bd-11dd-afb4-1d65580434c0
2009-11-11 09:06:51 +00:00
90e7825e55 Use intptr_t instead of int to cast from char* for Snow Leopard.
git-svn-id: https://google-glog.googlecode.com/svn/trunk@72 eb4d4688-79bd-11dd-afb4-1d65580434c0
2009-10-07 08:52:14 +00:00
7e610f65f5 Release 0.3.0.
git-svn-id: https://google-glog.googlecode.com/svn/trunk@71 eb4d4688-79bd-11dd-afb4-1d65580434c0
2009-07-31 05:27:23 +00:00
7e54f5ab11 Make the order of check for OS_WINDOWS|OS_CYGWIN and HAVE_PTHREAD consistent.
git-svn-id: https://google-glog.googlecode.com/svn/trunk@70 eb4d4688-79bd-11dd-afb4-1d65580434c0
2009-07-31 05:25:27 +00:00
1b5a90b691 Cast from pthread_t to pid_t via uintptr_t.
On 64bit NetBSD, pthread_t is a pointer and pid_t is an integer so
we cannot cast from pthread_t to pid_t directoly due to difference of
their size.


git-svn-id: https://google-glog.googlecode.com/svn/trunk@69 eb4d4688-79bd-11dd-afb4-1d65580434c0
2009-07-30 10:45:13 +00:00
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
4cd8381429 Add m4/pc_from_ucontext.m4. It supports NetBSD and OpenBSD as well.
Also, update the version of acx_pthread.m4


git-svn-id: https://google-glog.googlecode.com/svn/trunk@55 eb4d4688-79bd-11dd-afb4-1d65580434c0
2009-07-08 15:41:38 +00:00
424c6fc5c2 Fix regression of r23.
http://code.google.com/p/google-glog/source/detail?r=23


git-svn-id: https://google-glog.googlecode.com/svn/trunk@54 eb4d4688-79bd-11dd-afb4-1d65580434c0
2009-07-08 15:38:35 +00:00
f0f26f1ee0 Utilize AM_CXXFLAGS.
git-svn-id: https://google-glog.googlecode.com/svn/trunk@53 eb4d4688-79bd-11dd-afb4-1d65580434c0
2009-07-08 15:30:26 +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
94a3b0ed4f Add -lgflags into LD_FLAGS when gflags is detected and --with-gflags isn't specified. Thanks kzk for this patch!
git-svn-id: https://google-glog.googlecode.com/svn/trunk@49 eb4d4688-79bd-11dd-afb4-1d65580434c0
2009-04-22 04:28:59 +00:00
ca448a53a0 Release 0.2.1.
git-svn-id: https://google-glog.googlecode.com/svn/trunk@48 eb4d4688-79bd-11dd-afb4-1d65580434c0
2009-04-10 16:27:12 +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
e334c48314 Generation of pkg-config metadata file.
Thanks Tomasz for this contribution!


git-svn-id: https://google-glog.googlecode.com/svn/trunk@46 eb4d4688-79bd-11dd-afb4-1d65580434c0
2009-04-10 05:49:58 +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
e8531d6b71 Fix a silly bug. I submitted wrong version of auto generated script.
git-svn-id: https://google-glog.googlecode.com/svn/trunk@43 eb4d4688-79bd-11dd-afb4-1d65580434c0
2009-04-07 08:01:03 +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
0b79295aa9 Add mock-log.h into distribution.
git-svn-id: https://google-glog.googlecode.com/svn/trunk@37 eb4d4688-79bd-11dd-afb4-1d65580434c0
2009-01-23 22:50:55 +00:00
c545928d5c Release 0.2.
git-svn-id: https://google-glog.googlecode.com/svn/trunk@36 eb4d4688-79bd-11dd-afb4-1d65580434c0
2009-01-23 19:18:59 +00:00
f97a7c7332 Add README.windows, based on google-perftools'.
git-svn-id: https://google-glog.googlecode.com/svn/trunk@35 eb4d4688-79bd-11dd-afb4-1d65580434c0
2009-01-23 19:01:22 +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
a82b66f208 Add static library project and its unittest.
git-svn-id: https://google-glog.googlecode.com/svn/trunk@33 eb4d4688-79bd-11dd-afb4-1d65580434c0
2009-01-23 18:56:19 +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