]> git.proxmox.com Git - ceph.git/blob - ceph/src/rgw/rgw_request.cc
bump version to 12.2.12-pve1
[ceph.git] / ceph / src / rgw / rgw_request.cc
1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
3
4 #include "rgw_op.h"
5 #include "rgw_request.h"
6
7 #define dout_context g_ceph_context
8 #define dout_subsys ceph_subsys_rgw
9
10 /* XXX */
11 void RGWRequest::log_format(struct req_state *s, const char *fmt, ...)
12 {
13 #define LARGE_SIZE 1024
14 char buf[LARGE_SIZE];
15 va_list ap;
16
17 va_start(ap, fmt);
18 vsnprintf(buf, sizeof(buf), fmt, ap);
19 va_end(ap);
20
21 log(s, buf);
22 } /* RGWRequest::log_format */
23
24 void RGWRequest::log_init() {
25 ts = ceph_clock_now();
26 }
27
28 void RGWRequest::log(struct req_state *s, const char *msg) {
29 if (s->info.method && req_str.size() == 0) {
30 req_str = s->info.method;
31 req_str.append(" ");
32 req_str.append(s->info.request_uri);
33 }
34 utime_t t = ceph_clock_now() - ts;
35 dout(2) << "req " << id << ":" << t << ":" << s->dialect << ":"
36 << req_str << ":" << (op ? op->name() : "") << ":" << msg
37 << dendl;
38 }