Commit Graph

33 Commits

Author SHA1 Message Date
Thomas Goyne 23a21b33b1 Use a fixed-size buffer for log messages
libc++'s implementation of ostrstream seems to have incorrect
range-checking and does some out-of-bounds reads and writes whenever a
resize is needed, which results in crashes on 10.7 (but not 10.9 for
unknown reasons).
2013-12-09 12:47:32 -08:00
Thomas Goyne a7f4fb5b87 Run clang-modernize on things 2013-11-23 09:57:22 -08:00
Thomas Goyne 3306ee126d More unique_ptr 2013-06-11 20:54:07 -07:00
Thomas Goyne 5092ab20c9 Do logging on a background thread
Makes logging actually thread-safe and slightly improves performance.
2013-02-06 13:22:17 -08:00
Thomas Goyne a942687050 Use a circular buffer to store only the last 250 log messages 2013-02-06 13:22:16 -08:00
Thomas Goyne c6005be4a1 Write log files incrementally so that they actually exist for crashes 2013-02-06 13:22:16 -08:00
Thomas Goyne 101721863a Make log messages a little saner 2013-02-06 13:22:16 -08:00
Thomas Goyne 69e1744fc7 Make agi::util::time_log less insane 2013-02-06 13:22:16 -08:00
Thomas Goyne 1e0f08c0ed Mostly purge wxWidgets from non-UI stuff
Use boost::filesystem::path for all paths, and std::string for all other
strings, converting to/from wxString as close to the actual uses of wx
as possible.

Where possible, replace the uses of non-UI wxWidgets functionality with
the additions to the standard library in C++11, or the equivalents in
boost.

Move the path token management logic to libaegisub (and rewrite it in
the process).

Add a basic thread pool based on asio and std::thread to libaegisub.

This touches nearly every file in the project and a nontrivial amount of
code had to be rewritten entirely, so there's probably a lot of broken
stuff.
2013-02-06 13:22:15 -08:00
Thomas Goyne 96cf5ea7ed Kill the #ifndef AGI_PRE guards
They don't actually improve compilation performance and make it more
annoying to modify what things are in the precompiled header.
2012-12-02 06:33:29 -08:00
Thomas Goyne ebd56f2163 Include cstdint rather than stdint.h 2012-11-10 18:05:57 -08:00
Thomas Goyne e44c47c863 Remove $Id$ markers since git doesn't support them 2012-10-25 17:39:49 -07:00
Thomas Goyne e945c02151 Fix some warnings
Originally committed to SVN as r6919.
2012-06-25 14:21:32 +00:00
Thomas Goyne 0b9a21bf82 Hide SinkMessage's copy constructor and assignment operator
Originally committed to SVN as r6601.
2012-03-25 04:05:20 +00:00
Thomas Goyne e2d31b708e Split the json log writing into a seperate class from LogSink
Originally committed to SVN as r6248.
2012-01-08 01:36:23 +00:00
Thomas Goyne d148bbbf2a Make agi::log::LogSink take ownership of the emitters passed to it
Originally committed to SVN as r6246.
2012-01-08 01:36:09 +00:00
Thomas Goyne ba2794b2fe Replace some const strings with const references to strings
Originally committed to SVN as r5815.
2011-11-04 19:42:21 +00:00
Thomas Goyne 3c18ed542c Clean up libaegisub includes
Consistently use the C++ names for headers rather than a combination of the
C and C++ names.

Remove empty LAGI_PRE blocks.

Remove checks for both AGI_PRE and LAGI_PRE and change a check for only
AGI_PRE to LAGI_PRE.

Originally committed to SVN as r5516.
2011-07-26 22:25:21 +00:00
Amar Takhar 167f09a610 Merge the dynamic menu, hotkey and toolbar branch to trunk. This doesn't include Windows support as vs2008 was being a major pain. This involves revisions r4921:4950, r4961:5002, r5005:5006, r5008:5056, r5062:5065, r5072, r5081:5082, r5087, r5096:5110, r5124:5125. Updates #1258.
Originally committed to SVN as r5126.
2011-01-05 13:00:46 +00:00
Thomas Goyne b4739d2aee gcc 4.5 compilation fixes
Originally committed to SVN as r4797.
2010-10-11 04:25:02 +00:00
Thomas Goyne 929fa83dd9 Move the bulk of TextFileWriter's logic to libaegisub.
Originally committed to SVN as r4660.
2010-07-07 02:41:46 +00:00
Thomas Goyne 2b47f34e76 Fix a pile of actual memory leaks
Originally committed to SVN as r4575.
2010-06-24 01:24:09 +00:00
Thomas Goyne cbf201ab86 Fix some "leaks" of things that should actually be alive for the lifetime of the program to reduce noise.
Originally committed to SVN as r4574.
2010-06-24 01:24:02 +00:00
Thomas Goyne 5338a60cdb Fix compilation errors when not using precompiled headers
Originally committed to SVN as r4511.
2010-06-14 19:26:27 +00:00
Amar Takhar ea577f8245 Re-work types.h for the second time, this is most likely not the final version, it's difficult to figure out a solution that makes the most sense when most of the code hasn't been written/moved over yet.
Originally committed to SVN as r4468.
2010-06-09 02:07:43 +00:00
Amar Takhar 931cc7f461 * Remove all instances of wxLogDebug and replace them with LOG_W, LOG_D, LOG_E and LOG_D_IF as required.
* Add LOG_(D|W|I)_IF for conditional logging.

Originally committed to SVN as r4465.
2010-06-08 23:21:39 +00:00
Amar Takhar fc9e01c68a * Forward declare the LogSink global
* Change GetSink() to return a const pointer.

Originally committed to SVN as r4405.
2010-06-02 23:45:51 +00:00
Amar Takhar 33011cb5ed Split EmitterSTDOUT into unix/log.cpp and windows/log.cpp, the windows version is commented at the moment.
Originally committed to SVN as r4397.
2010-06-01 08:17:27 +00:00
Amar Takhar 7e83443c3e Fix the Windows build, there are a couple of things to note:
* I rebroke the stdout logger I'll fix that in unix.
 * There is a new header libaegisub/types.h which is a temp solution until I sort out something more realistic.  It's too early to tell what the proper solution will be.

Originally committed to SVN as r4394.
2010-06-01 08:03:17 +00:00
Amar Takhar badee30d17 Sigh, not diffing before committing bites me again: remove useless deltas that shouldn't have been committed.
Originally committed to SVN as r4392.
2010-06-01 05:14:00 +00:00
Amar Takhar 37b904b75e Create time_log() to return a timeval so I can implement this on windows as well.
Originally committed to SVN as r4391.
2010-06-01 05:11:18 +00:00
Amar Takhar 0a453fe127 Move Serverity_ID below the definition of log where it should be.
Originally committed to SVN as r4373.
2010-05-31 22:47:38 +00:00
Amar Takhar 9393850884 Commit the beginings of a logging api, this is fairly complete however it has no locking.
Originally committed to SVN as r4371.
2010-05-31 20:55:29 +00:00