2
* Copyright 2012 Google Inc.
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
* you may not use this file except in compliance with the License.
6
* You may obtain a copy of the License at
8
* http://www.apache.org/licenses/LICENSE-2.0
10
* Unless required by applicable law or agreed to in writing, software
11
* distributed under the License is distributed on an "AS IS" BASIS,
12
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
* See the License for the specific language governing permissions and
14
* limitations under the License.
17
// Author: piatek@google.com (Michael Piatek)
19
#ifndef PAGESPEED_KERNEL_BASE_REQUEST_TRACE_H_
20
#define PAGESPEED_KERNEL_BASE_REQUEST_TRACE_H_
24
#include "pagespeed/kernel/base/basictypes.h"
26
namespace net_instaweb {
28
// The context for recording a distributed trace associated with a given
33
virtual ~RequestTrace();
35
// Logs formatted output to the distributed tracing context.
36
virtual void TraceVPrintf(const char* fm, va_list argp) = 0;
37
void TracePrintf(const char* fmt, ...);
39
// Returns true iff tracing is enabled. This can be used to avoid virtual
40
// function call overhead in the common case that tracing is not active for
42
bool tracing_enabled() { return tracing_enabled_; }
43
void set_tracing_enabled(bool x) { tracing_enabled_ = x; }
46
bool tracing_enabled_;
48
DISALLOW_COPY_AND_ASSIGN(RequestTrace);
51
} // namespace net_instaweb
53
#endif // PAGESPEED_KERNEL_BASE_REQUEST_TRACE_H_