- boost::mutex::scoped_lock scoped_lock(m_p->m_log_mutex);
- std::cout << send_time << " " << m_p->m_msg;
- std::cout << " response id=" << package.session().id();
- std::cout << " close="
- << (package.session().is_closed() ? "yes " : "no ")
- << "duration=" << duration
- << "\n";
- //<< "duration=" << duration.total_seconds()
- // << "." << duration.fractional_seconds()
- // << "\n";
- gdu = package.response().get();
- if (gdu)
+ boost::mutex::scoped_lock scoped_lock(m_p->m_file->m_mutex);
+ if (m_p->m_res_session)
+ {
+ m_p->m_file->out << send_time << " " << m_p->m_msg;
+ m_p->m_file->out << " response id=" << package.session().id();
+ m_p->m_file->out << " close="
+ << (package.session().is_closed() ? "yes " : "no ")
+ << "duration=" << duration
+ << "\n";
+ }
+ if (m_p->m_res_apdu)
+ {
+ gdu = package.response().get();
+ if (gdu)
+ {
+ mp::odr odr(ODR_PRINT);
+ odr_set_stream(odr, m_p->m_file.get(), stream_write, 0);
+ z_GDU(odr, &gdu, 0, 0);
+ }
+ }
+ m_p->m_file->out.flush();
+ }
+}
+
+yf::Log::LFile::LFile(std::string fname) : m_fname(fname)
+{
+ out.open(fname.c_str());
+}
+
+void yf::Log::Rep::openfile(const std::string &fname)
+{
+ std::list<LFilePtr>::const_iterator it = filter_log_files.begin();
+ for (; it != filter_log_files.end(); it++)
+ {
+ if ((*it)->m_fname == fname)