589 Z_GDU *gdu_req = package.request().get();
590 std::string user(
"-");
592 yaz_timing_t timer = yaz_timing_create();
598 if (gdu_req && gdu_req->which == Z_GDU_Z3950)
600 Z_APDU *apdu_req = gdu_req->u.z3950;
601 if (apdu_req->which == Z_APDU_initRequest)
603 Z_InitRequest *req = apdu_req->u.initRequest;
604 Z_IdAuthentication *a = req->idAuthentication;
607 if (a->which == Z_IdAuthentication_idPass
608 && a->u.idPass->userId)
609 user = a->u.idPass->userId;
610 else if (a->which == Z_IdAuthentication_open)
617 std::map<mp::Session,std::string>::iterator it =
622 if (package.session().is_closed())
627 boost::mutex::scoped_lock scoped_lock(
m_file->m_mutex);
633 std::ostringstream os;
646 std::ostringstream os;
657 std::ostringstream os;
659 os <<
" request id=" << package.session().id();
661 << (package.session().is_closed() ?
"yes" :
"no");
667 if (gdu_req && gdu_req->which == Z_GDU_Z3950 &&
668 gdu_req->u.z3950->which == Z_APDU_initRequest)
670 std::ostringstream os;
672 yaz_init_opt_decode(gdu_req->u.z3950->u.initRequest->options,
682 mp::odr odr(ODR_PRINT);
686 z_GDU(odr, &gdu_req, 0, 0);
696 Z_GDU *gdu_res = package.response().get();
698 gdu_req = package.request().get();
700 yaz_timing_stop(timer);
701 double duration = yaz_timing_get_real(timer);
705 boost::mutex::scoped_lock scoped_lock(
m_file->m_mutex);
714 const char *message = wrbuf_cstr(w);
715 std::ostringstream os;
718 << std::fixed << std::setprecision (6) << duration
729 std::ostringstream os;
732 << std::fixed << std::setprecision (6) << duration
742 std::ostringstream os;
745 << std::fixed << std::setprecision (6) << duration << " "
753 std::ostringstream os;
755 os <<
" response id=" << package.session().id();
757 << (package.session().is_closed() ?
"yes " :
"no ")
759 << std::fixed << std::setprecision (6) << duration;
765 if (gdu_res && gdu_res->which == Z_GDU_Z3950 &&
766 gdu_res->u.z3950->which == Z_APDU_initResponse)
768 std::ostringstream os;
770 os <<
" init options:";
771 yaz_init_opt_decode(gdu_res->u.z3950->u.initResponse->options,
781 mp::odr odr(ODR_PRINT);
785 z_GDU(odr, &gdu_res, 0, 0);
792 yaz_timing_destroy(&timer);
static void log_1line_Z_GDU(Z_GDU *gdu_req, Z_GDU *gdu_res, WRBUF w)