+ gdu = package.response().get();
+ if (gdu)
+ {
+ m_p->m_file->out
+ //<< send_time << " "
+ //<< to_iso_string(send_time) << " "
+ << to_iso_extended_string(send_time) << " "
+ << m_p->m_msg_config << " "
+ << package << " "
+ << to_iso_string(duration) << " "
+ << *gdu
+ << "\n";
+ }
+ }
+
+ if (m_p->m_res_session)
+ {
+ m_p->m_file->out << send_time << " " << m_p->m_msg_config;
+ 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_init_options)
+ {
+ gdu = package.response().get();
+ if (gdu && gdu->which == Z_GDU_Z3950 &&
+ gdu->u.z3950->which == Z_APDU_initResponse)
+ {
+ m_p->m_file->out << receive_time << " " << m_p->m_msg_config;
+ m_p->m_file->out << " init options:";
+ yaz_init_opt_decode(gdu->u.z3950->u.initResponse->options,
+ option_write, m_p->m_file.get());
+ m_p->m_file->out << "\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), fout(fname.c_str()), out(fout)
+{
+}
+
+yf::Log::LFile::LFile(std::string fname, std::ostream &use_this) :
+ m_fname(fname), out(use_this)
+{
+}
+
+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)
+ {
+ m_file = *it;
+ return;