Changeset 16ae75ffd14588202aace31aaacf230469fd0758

Show
Ignore:
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:
1 modified

Legend:

Unmodified
Added
Removed
  • logger/logger.cc

    r628ff7a r16ae75f  
    2020#include "logger.hh" 
    2121 
     22#include <boost/date_time.hpp> 
    2223#include <iostream> 
    2324 
     
    2829        void logger_::open(std::string logfile)  
    2930        { 
     31                using namespace boost::posix_time; 
    3032                m.lock(); 
    3133                if (dirty) this->os->flush(); 
     
    3436                        (logfile.c_str(), std::ios_base::app); 
    3537                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; 
    3844                ours = true; 
    3945                m.unlock();