Changeset 16ae75ffd14588202aace31aaacf230469fd0758
- Timestamp:
- 06/26/10 16:11:46 (2 years ago)
- Author:
- Antti-Juhani Kaijanaho <ajk@…>
- Children:
- 341603a0f7acf173ecace38718deb66801483644
- Parents:
- 8d4f7f7d0239d22536f28b4900b2931d40a8537f
- git-committer:
- Antti-Juhani Kaijanaho <ajk@…> (06/26/10 16:11:46)
- Message:
-
Work around a bug in Boost
Signed-off-by: Antti-Juhani Kaijanaho <ajk@…>
- Files:
-
Legend:
- Unmodified
- Added
- Removed
-
|
r628ff7a
|
r16ae75f
|
|
| 20 | 20 | #include "logger.hh" |
| 21 | 21 | |
| | 22 | #include <boost/date_time.hpp> |
| 22 | 23 | #include <iostream> |
| 23 | 24 | |
| … |
… |
|
| 28 | 29 | void logger_::open(std::string logfile) |
| 29 | 30 | { |
| | 31 | using namespace boost::posix_time; |
| 30 | 32 | m.lock(); |
| 31 | 33 | if (dirty) this->os->flush(); |
| … |
… |
|
| 34 | 36 | (logfile.c_str(), std::ios_base::app); |
| 35 | 37 | if (!os) |
| 36 | | throw std::runtime_error("cannot open logfile"); |
| 37 | | dirty = false; |
| | 38 | throw std::runtime_error("cannot open logfile"); |
| | 39 | std::locale loc = os->getloc(); |
| | 40 | time_facet *tf = new time_facet(); |
| | 41 | tf->time_duration_format("%O:%M:%S%F"); |
| | 42 | os->imbue(std::locale(loc, tf)); |
| | 43 | dirty = false; |
| 38 | 44 | ours = true; |
| 39 | 45 | m.unlock(); |