122 Commits

Author SHA1 Message Date
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 c9cee5d9a077ce1e7e68f07cc30d03e4bed19c7b.

* 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 e3216391f536fa41c47067fdb0296c56bafa11fa.

* 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 e3216391f536fa41c47067fdb0296c56bafa11fa.
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