Commit Graph

28 Commits

Author SHA1 Message Date
Kjell Hedström
14db37ad23
G3log placeholder thread ID formatting (#248)
* Added thread ID configurable through API calls. Left to do g3sinks, documentation and some corner test cases for CHECK, LOG(FATAL) and FATAL signal

* improve test script, break if error

* easier to use API. Api docs added

* Update API.markdown

* Update API.markdown

* Update API.markdown

* updated readme with details for overriding default for "full details"

* updated custom sink with custom formatting example
2018-03-08 09:16:12 -07:00
Kjell Hedström
f2b860a2b4
Addressing the std2 concern raised in https://github.com/KjellKod/g3log/issues/212 (#246) 2018-02-20 22:02:19 -07:00
Andreas Schönle
82df2168aa CMake messages changed to message( STATUS "..." ) (#190) 2017-05-17 14:31:19 -06:00
Andreas Schönle
123977f106 unit tests running with windows shared dll (#178)
* unit tests running with windows shared dll

* CMake automatically uses DLL runtime - remove cmake entries modifying
compiler flags

* missing DBUG vs DEBUG issue in Linux

* generated header added

* correction in CMake: Set HEADER_FILES correctly

* added static library option

* switched to powershell and included WORKING_DIRECTORY

* powershell use in windows and WORKING_DIRECTORY instead of cd

* Fixed appveyor.yml to use Release configuration and run unit tests

* trying to make appveyor work again ...

* make sure ERRORLEVEL is 0 when unit tests run successfully

* Still trying to fix appveyor ...

* Defaulting to shared library in linux, too

* Removed runtime loading test when g3log is not a shared library in linux

* Run unit tests verbosly using ctest.exe

* Disabled AggressiveThreadCallsDuringShutdown test

* Revert "Run unit tests verbosly using ctest.exe" (accidental commit)

This reverts commit b30513450d.

* re-committing valid parts of reverted commit

* DBUG vs DEBUG fix moved to generated_definitions.hpp

* cleanup shared/static option

* clarify cmake build types regardless of type

* Added compile test for DEBUG and DBUG

* put back formatting

* Removed commented out /MD switches for MSVC
2017-05-09 10:26:48 -06:00
Kjell Hedström
33ed100f91 Colorer build and loglevel improvements (#161)
* static build with MS libs; remove vc11 support from cmake
* support AMD processor on winXp
* mingw build
* support older versions
* removed cmake warnings

* fix cmake >= 3.1 warnings (CMP0054)
* add target_include_directories - in projects that depend on g3log, do not need to specify include_directories
* Improved CPackage installation
* cleanup of build and test scripts
* c++14 gives for cleaner syntax
* build cleanup libg3logger.so will be a link to the actual libg3logger.so.<major><minor><build>. Only shared libraries from now on



* disableAll for log levels
* new setLogLevel impl
* cleaned up levels, now it should be easy for the user to understand how to add custom levels
2017-03-30 22:52:09 -06:00
SchoenleAndi
c39e77c27e DBUG-vs-DEBUG in main_ programs fixed 2016-10-19 13:39:24 +02: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
Kjell Hedsröm
11e22dd40d The sigsegv example exited by sigfpe. Fixed! 2015-11-22 16:35:36 -07:00
Kjell Hedstrom
fae01d5e92 Added missing test for custom signal handling for SIGTERM 2015-09-11 02:49:17 -06:00
Kjell Hedstrom
602e135f84 Added resotre and override signal handler 2015-09-10 06:20:26 -06:00
Kjell Hedstrom
055c4ec2ca Fixed for windows 2015-08-31 23:45: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
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
78103cb415 Auto generate macro defintions in a file. This way you don't have to re-state them in your library
if no options are given a blank file will be generated
2015-07-13 07:49:44 -06: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
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
7aea18edea Defines for turning off fatal handling for signals 2015-02-18 04:06:22 -07:00
Kjell Hedstrom
108922784d Changed what was thrown 2015-02-16 02:16:25 -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
KjellKod
938fc55971 What a mess to merge from Github/KjellKod/g3log to BitBucket/KjellKod/g3log 2015-02-02 00:31:43 -07:00
KjellKod
81a7c9109d Updated travis build script to accept any g++ version
Updated the fatal choice example with informative couts
2014-12-12 02:05:51 -07:00
KjellKod
fdd3c2572a Added a multiple,choice "Choose Your Fatal Exit" example.
Next step is to add the windows g3logger fatal exit handler (POC finished)
2014-12-12 08:44:17 -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