Commit Graph

110 Commits

Author SHA1 Message Date
kjell@kjell-win7.hsd1.co.comcast.net.
ebc8ae22b7 VS2013: removed warnings 2014-02-26 07:00:08 +01:00
KjellKod
8220839771 Clang/Gcc bugfix:
Fixed g2logworker destructor race condition. Sinks and background thread were not cleared in the right order.
Now the order is enforced.

This means that g3log should work fine with Clang. CMakeLists.txt is updated to reflect the Clang support
2014-02-25 22:05:48 -07:00
KjellKod
59269ec351 Removed vs2013 warning. Previously the exception was ignored. 2014-02-24 00:29:50 -07:00
KjellKod
40a6e99bc0 Work around for bug in VS2013. Reported here: http://www.beta.microsoft.com/VisualStudio/feedback/details/757472/c-concurrency-task-and-std-bind
"auto" did not cut it apparently.
2014-02-24 00:23:43 -07:00
KjellKod
956da51317 Thanks to Aleksey Dobrunov who noticed this compile error. Weird that it did not show up in gcc 2014-02-24 00:21:57 -07:00
KjellKod
1ed4bcb38c Bugfix: sinkhandle can now be used to call, asynchronously, functions with more return types than std::string 2014-02-11 20:00:20 -07:00
KjellKod
ffb4d86c1e Improvement: Shutdownlogging is now called AUTOMATICALLY at LogWorker scope exit/destruction. If for some reason (mistake or unit testing) multiple LogWorkers are created then
only the one that is g2::initialized(...) can cause a shutDownLogging when it is destructed.
2014-02-02 23:49:24 -07:00
KjellKod
0c1845ee18 Avoid premature wakeup from reader thread by doing the notify AFTER the mutex is released
http://www.justsoftwaresolutions.co.uk/threading/implementing-a-thread-safe-queue-using-condition-variables.html
2014-01-24 13:17:10 -07:00
KjellKod
63616d2acd performance increase by using internal unique_ptr for the sink instead of shared_pointer.
Better average (10-15%), and much, much, much better worst case
2014-01-19 22:55:44 -07:00
kjell@kjell-win7.hsd1.co.comcast.net.
cc554ff2cc comment fix 2014-01-14 07:18:38 +01:00
kjell@kjell-win7.hsd1.co.comcast.net.
9df4fbd99c constexpr and static_assert when NOT on MSVC. #ifdef workaround for MSVC 2014-01-14 07:10:26 +01:00
kjell@kjell-win7.hsd1.co.comcast.net.
9f015b4216 Performance fix: g2time return string without unnecessary (old) stream buffering 2014-01-14 07:07:00 +01:00
KjellKod
1ac2e9070e Thanks to Aleksey Dobrunov: Improvement by making all raw data in the g2logmessage public
Added explaining comments to g2logmessage
2014-01-10 09:18:27 -07:00
KjellKod
5486bbceca Dynamic logging levels can be enabled with a define. All levels are by default ON 2014-01-08 22:48:18 -07:00
Aleksey Dobrunov
beff32d718 mingw build 2013-12-30 13:44:32 +06:00
KjellKod
916f478267 Updated performance test in case all "buckets" hits would be in the 0ms bucket then it is shown in us instead 2013-12-28 14:58:22 -07:00
kjell@kjell-win7.hsd1.co.comcast.net.
e850c33354 pragma remove 2013-12-28 20:52:46 +01:00
kjell@kjell-win7.hsd1.co.comcast.net.
c2b328bfe8 comment and pragma cleanup 2013-12-28 20:46:56 +01:00
kjell@kjell-win7.hsd1.co.comcast.net.
913208bba8 part of previous commit (missed description)
stlpatch to make vs2013 work with packaged_task<void()>.
Thanks to Michael Rasmussen (lap777).
Ref: http://connect.microsoft.com/VisualStudio/feedback/details/791185/std-packaged-task-t-where-t-is-void-or-a-reference-class-are-not-movable
2013-12-28 20:42:50 +01:00
kjell@kjell-win7.hsd1.co.comcast.net.
a522c219ce cleaned up time use 2013-12-28 20:39:12 +01:00
KjellKod
2e5d323b52 Input from Gem Chen triggerd review of shared_queue (now made clearer) and active.hpp (now all header file) 2013-12-19 23:47:31 -07:00
KjellKod
74963e13f1 Bugfix: stackdump not called at the right place for failed contracts and LOG(FATAL) 2013-12-19 22:55:10 -07:00
KjellKod
c847ee037f removed old fatal test 2013-12-19 22:52:09 -07:00
KjellKod
8d9f1bfea2 split FATAL examples into a SIGSEGV and a CONTRACT examplew 2013-12-19 22:51:47 -07:00
KjellKod
8f7db77177 crashhandler_unix now with support for OSX/Clang 2013-12-15 22:44:53 -07:00
KjellKod
fe4862a96b Cleanup, added headers where they were missing. Removed default option ON for unit test. 2013-12-15 22:29:26 -07:00
KjellKod
507ec52c04 merging heads 2 of 2
--HG--
rename : g2log/src/g2sinkhandle.h => g2log/src/g2sinkhandle.hpp
2013-12-15 22:17:06 -07:00
KjellKod
97a6492d81 merging heads 1 of 2 2013-12-15 22:16:32 -07:00
KjellKod
d5ec3424e5 Renaming, moving from .h to .hpp. Should not affect API, mostly internal stuff
--HG--
rename : g2log/src/g2future.h => g2log/src/g2future.hpp
rename : g2log/src/g2sink.h => g2log/src/g2sink.hpp
rename : g2log/src/g2sinkhandle.h => g2log/src/g2sinkhandle.hpp
rename : g2log/src/g2sinkwrapper.h => g2log/src/g2sinkwrapper.hpp
rename : g2log/src/shared_queue.h => g2log/src/shared_queue.hpp
2013-12-15 22:13:43 -07:00
Aleksey Dobrunov
c2ba2546bb fix unit tests 2013-12-14 02:58:36 +06:00
Aleksey Dobrunov
f3dda737ed fix build program that uses g2log 2013-12-14 02:50:29 +06:00
Aleksey Dobrunov
781b1c1b5e add build target for mingw 2013-12-14 01:39:50 +06:00
Aleksey Dobrunov
768f6a3ae5 fix warning in CMakeLists.txt 2013-12-14 01:39:03 +06:00
Aleksey Dobrunov
e35a9df89f fix crashhandler for windows 2013-12-14 01:12:35 +06:00
Aleksey Dobrunov
570a2d8f10 fix colon in log path 2013-12-14 01:07:07 +06:00
Aleksey Dobrunov
c76f2fc5bd fix time for mingw 2013-12-14 01:04:28 +06:00
KjellKod
aeadc490b1 Thanks to Rui Pacheco. Bugfix: could occurr if logger was initialized, had "shutownlogging" and then a fatal signal occurred 2013-12-13 08:36:45 -07:00
KjellKod
68e3d2f1a5 showing worst times in ms and us 2013-12-10 15:29:43 -07:00
KjellKod
f8c729ce1e dynamic logging levels are now possible. Use "#define G2_DYNAMIC_LOGGING" to get it. A slight performance penalty will result
but logging levels can then be turn on/off dynamically
2013-12-10 14:57:04 -07:00
KjellKod
340c4ac1d5 Fixed compile error for gcc 4.7.3 2013-12-10 10:46:27 -07:00
KjellKod
7de3c5fe78 merging heads
--HG--
branch : merge
2013-12-10 10:36:21 -07:00
KjellKod
8da7e44cd0 slight performance increase 2013-11-23 13:42:03 -07:00
kjell@kjell-win7.hsd1.co.comcast.net.
84f5dddc69 msbuild detected issues (ms only?) 2013-11-23 09:12:00 +01:00
KjellKod
c28593e87e Even faster. Using internal MoveOnCopy struct-wrapper. 2013-11-15 02:02:30 -07:00
KjellKod
889145453d Updated ... performance testing in purpose. 2x1million takes 18seconds to disk. average API calls 7us, average API call and bg disk write 9us
--HG--
rename : g2log/src/g2pretendtobecopyable.hpp => g2log/src/g2moveoncopy.hpp
2013-11-14 22:27:03 -07:00
KjellKod
e430a40884 printout if dynamic level is enabled or not 2013-11-13 01:19:33 -07:00
KjellKod
54925d3ba2 Forg 2013-11-13 01:03:42 -07:00
KjellKod
b1ed735d39 Speedup. Inline functions and toString uses string and not ostringstream 2013-11-12 03:37:36 -07:00
KjellKod
2ba9d6187c All unit test working. Next step is to increase performance even more 2013-11-12 02:45:09 -07:00
KjellKod
61af55e335 (after 1 day of lost work)... recreating-work in progress. some unit test are still failing. Using unique_ptr for spee 2013-11-12 02:21:40 -07:00