Andreas Schönle
2ebb9c2346
Merge branch 'master' into windows-time-fix
2016-12-19 17:03:23 +01:00
Kjell Hedström
34aa4ff8d6
Update time.cpp
...
removed ifdef's and using Andreas' implementation of get_time
2016-12-09 23:26:20 -07:00
Kjell Hedström
6bf8afddfa
Merge pull request #133 from AbberiorInstruments/arm-fix
...
compiles on arm
2016-12-09 23:02:21 -07:00
Kjell Hedström
b7adc0e77d
fix formatting to get the branch merged
2016-12-09 23:02:04 -07:00
Andreas Schönle
03734dd29c
alternative, better fix as proposed by Kjell
2016-12-06 17:36:17 +01:00
Andreas Schönle
8d01c2224d
reverted file parameter to std::string reference, adjusted formatting
2016-12-06 17:13:27 +01:00
Andreas Schönle
f018f3e92f
Fixed formatting
2016-12-06 14:34:23 +01:00
Andreas Schönle
793ddbd42e
changed to copying the file path upon message creation
2016-12-06 14:07:01 +01:00
SchoenleAndi
b1088d06ab
Merge branch 'master' into include-file-path-only
2016-12-04 19:17:39 +01:00
SchoenleAndi
069085c451
fix timing inaccuracy on windows
2016-12-04 16:09:23 +01:00
SchoenleAndi
e93031c6d0
compiles on arm
2016-12-02 17:01:16 +01:00
SchoenleAndi
1dafdaf2a4
msfc fromat specifiers added
2016-10-19 13:41:48 +02:00
SchoenleAndi
c467851423
save include fil full path as const char * in LogMessage
2016-10-19 13:21:52 +02:00
Kjell Hedström
ba81287ca5
bugfix time formatting ( #119 )
...
* bugfix time formatting
* fixit
2016-08-30 18:34:13 -06:00
Lynn
1bae2e6a68
Typo fix (Vaulue → Value) ( #120 )
...
* typo fix (Vaulue → Value)
* typo fix (Vaulue → Value)
2016-08-30 11:10:58 -06:00
Kjell Hedstrom
e0fb4fd24e
fixit
2016-08-25 00:51:21 -06:00
Kjell Hedstrom
26f76cd103
bugfix time formatting
2016-08-25 00:49:17 -06:00
Kjell Hedström
9b8e13bcfe
Update crashhandler.hpp ( #110 )
...
Thanks to @graugans
2016-08-11 07:08:41 -06:00
Kjell Hedström
86473c60e0
Gimesketvirtadien's time requested changes ( #104 )
...
* Added "removeSink" method and related functionality to LogWorker API
* Added a new API for plugging in custom Timestamp generator.
* Revert "Added "removeSink" method and related functionality to LogWorker API"
This reverts commit c9cee5d9a0
.
* Dropping shared_ptr<Timestamp> in log messages and using regular vars
* Moving to standard timespec struct from custom Timestamp
* Wiring timespec timestamps with formating routine
* Falling back to clock_gettime
* Reverting g3 API changes
* Optimizing format string generation
* Removed _microseconds from LogMessage
* Implemented sec fractional format key
* Optimization of format string generation
* Adjusting comments
* Refining localtime_formatted by introducing two helper functions
* refactored and simplified code
* fixed up some commented away unit tests
* refactoring message specifics tests to it's own test
* Use gcc 4.9
* C++14 for Linux
* Update .travis.yml
* Update buildAndRunTests.sh
* lower case in `-std=c++14`
* -lrt flag for gcc
* Added support for high precision clock on Linux/gcc (already there now for OSX). Windows is still missing
* intermediate comments
* Clarified for some code readers the mysterious use of assert in an expression that is always true
* refactored + renamed functions and constants. Added unit test for retrieving fractional type
* committing changes previously fixed - finished unit testing for g3::internal::time::GetFractional(..)
* added unit test for fractional to string
* added missing unit tests for localtime_formatted
* fixed? nano / microsec functionality to timer
* test
2016-08-11 00:27:52 -06:00
jkhoogland
ff722164d4
Warning braces loglevels clang 3.7 ( #108 )
...
* Fix gcc compiler warning for braces around scalar
* use 'toString' to get the formatted output in the fatal cerr message when a LOG fatal or CONTRACT happens. This was already OK on the sink side
* Avoid initialization/shutdown deadlock that could occur due to wrong use of the API
* Workaround for windows testing (#100 )
* added automatic linking pragma for `StackWalk64` (#96 )
* fix to implicit type casting (#98 )
* create a Xcode project
* fixed to implicit type casting
* Revert "create a Xcode project"
This reverts commit e3216391f5
.
* Fixed a bug causing cross-compilers to fail (#101 )
(The edited line eliminated the original CXXFLAGS variable, removing the sysroots parameter, which is needed for cross compiling)
* Update logworker.cpp (#103 )
* Fix gcc compiler warning for braces around scalar
* Add back braces
2016-07-31 17:01:54 -06:00
Kjell Hedström
e0d4434428
Update logworker.cpp ( #103 )
2016-06-23 21:35:59 -06:00
Dmitry Ledentsov
f10fbe1d9c
added automatic linking pragma for StackWalk64
( #96 )
2016-06-12 16:57:55 -06:00
JiHyung Lee
736d6437b8
fix to implicit type casting ( #98 )
...
* create a Xcode project
* fixed to implicit type casting
* Revert "create a Xcode project"
This reverts commit e3216391f5
.
2016-06-12 14:09:55 -06:00
Kjell Hedstrom
70b37d66a0
Avoid initialization/shutdown deadlock that could occur due to wrong use of the API
2016-05-23 22:25:32 -06:00
Kjell Hedstrom
bfe1e8ad19
use 'toString' to get the formatted output in the fatal cerr message when a LOG fatal or CONTRACT happens. This was already OK on the sink side
2016-03-30 16:35:38 -06:00
Kjell Hedström
4472ba3cbf
fix the tool, not the code
2016-03-24 10:43:09 -06:00
Kjell Hedström
d01dfbf992
revert "fix" for issue with checkmarx. The tool should be fixed, not the code
2016-03-24 10:41:23 -06:00
Kjell Hedstrom
8df4eadd92
removed false positives as detected by Checkmarx code analysis tool. Not impressed so far though with the tool
2016-03-18 10:50:59 -06:00
Kjell Hedström
5790c3723f
Merge pull request #80 from KjellKod/Thread_local
...
Update stacktrace_windows.cpp
2016-02-24 19:16:09 -07:00
Kjell Hedsröm
b7704b1ed7
fixed merge conflict
2016-02-17 00:06:45 -07:00
Kjell Hedsröm
1ebaf0e7e5
fixed conflict
2016-02-16 23:16:22 -07:00
Kjell Hedsröm
a0b961ee04
Allow parenthesis in path and filename
2016-02-16 22:52:38 -07:00
Kjell Hedström
279587c567
Update stacktrace_windows.cpp
...
For access to thread_local definition
2016-02-16 20:55:28 -07:00
Jiri Hoogland
e981b08c81
Put include headers back per request of Kjell
2016-02-03 18:19:36 -05:00
Jiri Hoogland
b8f28d3a49
Fix missing include files
2016-02-02 19:05:29 -05:00
Jiri Hoogland
31c01b168c
Add ability for user to override 'g3log' monniker in log file
2016-01-28 10:02:22 -05:00
Aleksey Dobrunov
69e0cafee8
fix unit test
2016-01-27 13:56:14 -05:00
Aleksey Dobrunov
0384eb1638
fix build lib
2016-01-27 13:56:14 -05:00
Aleksey Dobrunov
c9e93c8d14
remove unused include
2016-01-27 13:56:14 -05:00
Aleksey Dobrunov
444642f47b
fix unit test
2016-01-11 23:48:56 +05:00
Aleksey Dobrunov
1f4ffbeb6f
fix build lib
2016-01-11 23:47:00 +05:00
Aleksey Dobrunov
12beaf89de
remove unused include
2016-01-11 00:41:05 +05:00
Kjell Hedström
e97656b902
Merge pull request #56 from turenar/thread_local
...
suppress 'thread attribute directive ignored' warning on mingw
2015-11-26 19:31:34 -07:00
cstamatopoulos
499d1a51ef
fix msvc2013 compilation issue of internal::g_log_level_status on reset()
2015-11-24 01:46:27 -05:00
Kjell Hedsröm
2cef7cb174
Merge branch 'master' of github.com:KjellKod/g3log into API_Documentation
...
Conflicts:
test_unit/test_io.cpp
2015-11-23 23:12:30 -07:00
Kjell Hedsröm
df093e3563
Documentation done till fatal handling.
...
Improved logging levels
2015-11-22 16:01:53 -07:00
Kjell Hedström
4b3c4d7ff7
flush after every write: https://github.com/KjellKod/g3log/issues/57
...
https://github.com/KjellKod/g3log/issues/57
2015-11-03 13:35:47 -07:00
Turenar
fa15177d58
suppress 'thread attribute directive ignored' warning on mingw
...
make thread_local workaround on only <=VS2013
VS2015 has thread_local specifier
2015-10-30 16:09:39 +09:00
Craig Cogdill
051fb50c98
Adding the function name and saving the day
2015-09-16 16:29:48 -06:00
Kjell Hedstrom
403f3cb94f
Improve default formatting
...
Instead of
<date and time> <file>:L<line> ....
have
<date and time>**<file>:<line>**
2015-09-14 19:03:32 -06:00
Kjell Hedstrom
a1a3672d71
Missing include
2015-09-11 03:23:24 -06:00
Kjell Hedstrom
602e135f84
Added resotre and override signal handler
2015-09-10 06:20:26 -06:00
Kjell Hedstrom
3bcf360815
vanilla example. dynamic signal turning on/off
2015-09-01 00:35:47 -06:00
Kjell Hedstrom
a8d89b67c8
Merge branch 'clang-improved-crash-handling' of https://github.com/KjellKod/g3log into clang-improved-crash-handling
...
Conflicts:
Build.cmake
example/main_fatal_choice.cpp
2015-08-31 23:07:25 -06:00
Kjell Hedstrom
a068575595
removed comments. improved death test
2015-08-31 22:30:48 -06:00
Kjell Hedstrom
671fd01aa1
This is made to NOT compile ... lines that don't compile are sections I need to check out
...
exhausted stack. kill vs exit. using libunwind or backtrace but with symoblizer should be tested
and blogged about(?)
2015-08-27 08:02:18 -06:00
Kjell Hedstrom
3efcef3505
my own code review I
2015-08-19 10:19:55 -06:00
Kjell Hedstrom
1803498e89
Breaking change but a good change: Cleared up the API for Creating log worker and Adding sinks
2015-08-19 10:08:41 -06:00
Kjell Hedstrom
14a46f4567
Swap is less affective
2015-08-12 07:39:09 -06:00
Kjell Hedstrom
c6a0c28435
removed iostream previously used for temporary visibility
2015-08-12 06:48:55 -06:00
Kjell Hedstrom
8dfe9e0716
Improved copy constructors and assignment operator which is needed now when LOGLEVELS can be made on the fly
2015-08-12 06:43:24 -06:00
Kjell Hedstrom
13cc398f06
comparison operators for level: gtest, std::find, == operator, !=operator
2015-08-04 07:43:38 -06:00
Kjell Hedstrom
d09ca7787d
use the genereated_definitions.hpp
2015-07-22 13:28:10 -06:00
Kjell Hedstrom
540e9601df
handling the case of DEBUG to DBUG
2015-07-20 08:23:49 -06:00
Kjell Hedstrom
d5ad2709a7
removed changes to g3::only_change_at_initialization at shutdown/init.
...
It is thread unsafe and should be done explicitly (also the threaded 100 threads calling with initialzation + shutdown was handing)... good test
2015-07-20 08:11:57 -06:00
Kjell Hedstrom
786b92a6d1
Another, tiny, breaking change.
...
Due to popular request I have added the possibility to put in your own custom log levels. Due to performance regards changes to the log levels should ONLY be done
in a single thread context (initialiation) for that reason the namespace
used to "setLogLevel" is named appropriately
i.e. use: g3::only_change_at_initialization::setLogLevel(...)
2015-07-20 08:00:33 -06:00
Kjell Hedstrom
c4f9463b6b
Custom levels can be added: So far dynamic on-off does not work
2015-07-20 00:45:41 -06:00
Kjell Hedstrom
7c7012325d
Easier to install. continues
...
1) Breaking change: g3 namespace replaces g2
2) g2log.hpp remains in src/g2log.hpp... but now all it does is to include the g3log.hpp, etc
3) ALL HEADER FILES ARE IN src/g3log/ while all .cpp and .ipp files are in /src (exception for g2log.hpp)
This should make it EASIER for clients to copy/install the header files to the new location. It greatly simplifies
rpm and cpackage installationsw
2015-07-19 23:10:56 -06:00
Kjell Hedstrom
6750efe8fe
g2log.hpp is kept as a helper include. It will pull in the most frequent include files
...
All other are under g3log. Example: #include <g3log/time.hpp> #include <g3log/g3log.hpp> etc
This makes sure that the package manager (to be used soon) does NOT clutter any /usr/local/include space
instead all the includes will be in /usr/local/include/g3log (or similar)
2015-07-16 01:55:23 -06:00
Kjell Hedstrom
ebcfe9ff06
remove windows warnings. Thanks to @ctapmex
2015-06-24 14:50:46 -06:00
Kjell Hedstrom
176fca55a6
Thanks to @Bob Flynn:
...
Separated the microseconds counter with a space instead of a period.
Also added explanation that the counter is from the initialization
2015-06-24 14:32:31 -06:00
KjellKod
37989ed52f
merging headswq
2015-05-03 22:41:20 -06:00
Kostya Bazhanov
43652ef7c9
Fix -Wextra-semi Clang warning.
...
--HG--
branch : pr4
2015-04-29 12:24:11 +03:00
Kostya Bazhanov
4686fb9cc2
Remove trailing spaces.
...
--HG--
branch : pr4
2015-04-29 12:23:30 +03:00
Kostya Bazhanov
8e4929cbdb
Fix -Wunused-function Clang warning.
...
--HG--
branch : pr4
2015-04-29 12:22:26 +03:00
Kostya Bazhanov
cb097cbd3e
Remove trailing spaces.
...
--HG--
branch : pr4
2015-04-29 12:21:45 +03:00
David Gayerie
4c45244391
fixing cross compilation on Linux for MINGW gcc 4.8.2
2015-03-29 14:29:07 +02:00
Kjell Hedstrom
7c5254c80b
thread_local issues on Linux, using atomic instead
2015-03-02 02:02:43 -07:00
Kjell Hedstrom
58ffeac9bc
Clarified issue with __debugbreak()
2015-03-02 01:17:52 -07:00
Kjell Hedstrom
a5d922de49
__debugbreak in windows can easily cause recursive crashes if you are
...
NOT in debug mode in your visual IDE
2015-03-02 01:14:03 -07:00
Kjell Hedstrom
cc5cf169ba
After code review by Kamil.
...
Moved internal API to public API.
g2log.hpp/cpp g2::setFatalPreLoggingHook(...) and g2::setFatalExitHandler(...)
2015-02-23 23:29:02 -07:00
Kjell Hedstrom
a69eb201a1
Pre-fatal-log hook for usage before the fata log is sent to sinks
2015-02-22 23:31:17 -07:00
Kjell Hedstrom
fc1acd742d
1) windows exception will now trigger break point in VS
...
2) Fatal signal will in DEBUG trigger a break point in VS
- It can be disabled by a #define
3) signal handler can be disabled by a #define
2015-02-18 03:55:16 -07:00
Kjell Hedstrom
eab596cfac
Added exception handling comment
2015-02-16 02:31:16 -07:00
Kjell Hedstrom
81885e4456
Enabled vectored exception crash handling, it can also be turned off easily with a define
...
cmake -DENABLE_VECTORED_EXCEPTIONHANDLING=OFF
2015-02-16 01:37:55 -07:00
Kjell Hedstrom
4c7c5c7ca7
Disabled Vectored exception handling: TEMPORARILY.
...
It will likely be enabled shortly but with
1) options for enabling/disabling it
2) use of unit test for unknown exceptions (and known)
to make sure that 3rd party libraries that use exceptions (sigh)
way too frequently are not affected.
3) only handling "known exceptions" unknown exceptions will get perhaps a
LOG(WARNING) but no more "exiting"
2015-02-03 22:53:01 -07:00
Kjell Hedstrom
b3e7032678
Signals seems to have to be installed for EVERY thread
2015-02-02 21:35:48 -07:00
KjellKod
938fc55971
What a mess to merge from Github/KjellKod/g3log to BitBucket/KjellKod/g3log
2015-02-02 00:31:43 -07:00
kjellkod@kjellkod-Asus.hsd1.co.comcast.net.
c23a8e2419
Remove warning in Windows by using vsnprintf_s
2014-12-11 00:10:47 -07:00
KjellKod
87a095e384
Renamed directories for a cleaner project structure
...
--HG--
rename : g2log/Build.cmake => Build.cmake
rename : g2log/CMakeLists.txt => CMakeLists.txt
rename : g2log/CPackLists.txt => CPackLists.txt
rename : g2log/Dynamic.cmake => Dynamic.cmake
rename : g2log/example/Example.cmake => example/Example.cmake
rename : g2log/example/main_contract.cpp => example/main_contract.cpp
rename : g2log/example/main_sigsegv.cpp => example/main_sigsegv.cpp
rename : g2log/src/active.hpp => src/active.hpp
rename : g2log/src/crashhandler.hpp => src/crashhandler.hpp
rename : g2log/src/crashhandler_unix.cpp => src/crashhandler_unix.cpp
rename : g2log/src/crashhandler_win.cpp => src/crashhandler_win.cpp
rename : g2log/src/g2filesink.cpp => src/g2filesink.cpp
rename : g2log/src/g2filesink.hpp => src/g2filesink.hpp
rename : g2log/src/g2filesinkhelper.ipp => src/g2filesinkhelper.ipp
rename : g2log/src/g2future.hpp => src/g2future.hpp
rename : g2log/src/g2log.cpp => src/g2log.cpp
rename : g2log/src/g2log.hpp => src/g2log.hpp
rename : g2log/src/g2loglevels.cpp => src/g2loglevels.cpp
rename : g2log/src/g2loglevels.hpp => src/g2loglevels.hpp
rename : g2log/src/g2logmessage.cpp => src/g2logmessage.cpp
rename : g2log/src/g2logmessage.hpp => src/g2logmessage.hpp
rename : g2log/src/g2logmessagecapture.cpp => src/g2logmessagecapture.cpp
rename : g2log/src/g2logmessagecapture.hpp => src/g2logmessagecapture.hpp
rename : g2log/src/g2logworker.cpp => src/g2logworker.cpp
rename : g2log/src/g2logworker.hpp => src/g2logworker.hpp
rename : g2log/src/g2moveoncopy.hpp => src/g2moveoncopy.hpp
rename : g2log/src/g2sink.hpp => src/g2sink.hpp
rename : g2log/src/g2sinkhandle.hpp => src/g2sinkhandle.hpp
rename : g2log/src/g2sinkwrapper.hpp => src/g2sinkwrapper.hpp
rename : g2log/src/g2time.cpp => src/g2time.cpp
rename : g2log/src/g2time.hpp => src/g2time.hpp
rename : g2log/src/shared_queue.hpp => src/shared_queue.hpp
rename : g2log/src/std2_make_unique.hpp => src/std2_make_unique.hpp
rename : g2log/src/stlpatch_future.hpp => src/stlpatch_future.hpp
rename : g2log/test_performance/Performance.cmake => test_performance/Performance.cmake
rename : g2log/test_performance/main_threaded_mean.cpp => test_performance/main_threaded_mean.cpp
rename : g2log/test_performance/main_threaded_worst.cpp => test_performance/main_threaded_worst.cpp
rename : g2log/test_performance/performance.h => test_performance/performance.h
rename : g2log/test_unit/Test.cmake => test_unit/Test.cmake
rename : g2log/test_unit/test_concept_sink.cpp => test_unit/test_concept_sink.cpp
rename : g2log/test_unit/test_configuration.cpp => test_unit/test_configuration.cpp
rename : g2log/test_unit/test_filechange.cpp => test_unit/test_filechange.cpp
rename : g2log/test_unit/test_io.cpp => test_unit/test_io.cpp
rename : g2log/test_unit/test_linux_dynamic_loaded_sharedlib.cpp => test_unit/test_linux_dynamic_loaded_sharedlib.cpp
rename : g2log/test_unit/test_sink.cpp => test_unit/test_sink.cpp
rename : g2log/test_unit/tester_sharedlib.cpp => test_unit/tester_sharedlib.cpp
rename : g2log/test_unit/tester_sharedlib.h => test_unit/tester_sharedlib.h
rename : g2log/test_unit/testing_helpers.cpp => test_unit/testing_helpers.cpp
rename : g2log/test_unit/testing_helpers.h => test_unit/testing_helpers.h
2014-10-03 01:20:33 -06:00