~alinuxninja/nginx-edge/trunk

« back to all changes in this revision

Viewing changes to debian/modules/ngx_pagespeed/psol/include/third_party/mod_spdy/src/mod_spdy/apache/log_message_handler.h

  • Committer: Vivian
  • Date: 2015-12-04 18:20:11 UTC
  • Revision ID: git-v1:a36f2bc32e884f7473b3a47040e5411306144d7d
* Do not extract psol.tar.gz

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
// Copyright 2010 Google Inc.
2
 
//
3
 
// Licensed under the Apache License, Version 2.0 (the "License");
4
 
// you may not use this file except in compliance with the License.
5
 
// You may obtain a copy of the License at
6
 
//
7
 
//      http://www.apache.org/licenses/LICENSE-2.0
8
 
//
9
 
// Unless required by applicable law or agreed to in writing, software
10
 
// distributed under the License is distributed on an "AS IS" BASIS,
11
 
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
 
// See the License for the specific language governing permissions and
13
 
// limitations under the License.
14
 
 
15
 
#ifndef MOD_SPDY_APACHE_LOG_MESSAGE_HANDLER_H_
16
 
#define MOD_SPDY_APACHE_LOG_MESSAGE_HANDLER_H_
17
 
 
18
 
#include <string>
19
 
 
20
 
#include "httpd.h"
21
 
#include "apr_pools.h"
22
 
 
23
 
#include "base/basictypes.h"
24
 
 
25
 
namespace mod_spdy {
26
 
 
27
 
class SpdyStream;
28
 
 
29
 
// Stack-allocate to install a server-specific log handler for the duration of
30
 
// the current scope (on the current thread only).  For example:
31
 
//
32
 
//   void SomeApacheHookFunction(server_rec* server) {
33
 
//     ScopedServerLogHandler handler(server);
34
 
//     ...call various other functions here...
35
 
//   }
36
 
//
37
 
// The log handler will be in effect until the end of the block, but only for
38
 
// this thread (even if this thread spawns other threads in the meantime).
39
 
// Establishing this server-specific log handler allows LOG() macros within
40
 
// called functions to produce better messages.
41
 
class ScopedServerLogHandler {
42
 
 public:
43
 
  explicit ScopedServerLogHandler(server_rec* server);
44
 
  ~ScopedServerLogHandler();
45
 
 private:
46
 
  DISALLOW_COPY_AND_ASSIGN(ScopedServerLogHandler);
47
 
};
48
 
 
49
 
// Stack-allocate to install a connection-specific log handler for the duration
50
 
// of the current scope (on the current thread only).  See the doc comment for
51
 
// ScopedServerLogHandler above for an example.
52
 
class ScopedConnectionLogHandler {
53
 
 public:
54
 
  explicit ScopedConnectionLogHandler(conn_rec* connection);
55
 
  ~ScopedConnectionLogHandler();
56
 
 private:
57
 
  DISALLOW_COPY_AND_ASSIGN(ScopedConnectionLogHandler);
58
 
};
59
 
 
60
 
// Stack-allocate to install a stream-specific log handler for the duration of
61
 
// the current scope (on the current thread only).  See the doc comment for
62
 
// ScopedServerLogHandler above for an example.
63
 
class ScopedStreamLogHandler {
64
 
 public:
65
 
  explicit ScopedStreamLogHandler(conn_rec* slave_connection,
66
 
                                  const SpdyStream* stream);
67
 
  ~ScopedStreamLogHandler();
68
 
 private:
69
 
  DISALLOW_COPY_AND_ASSIGN(ScopedStreamLogHandler);
70
 
};
71
 
 
72
 
// Install a log message handler that routes LOG() messages to the
73
 
// apache error log.  Should be called once, at server startup.
74
 
void InstallLogMessageHandler(apr_pool_t* pool);
75
 
 
76
 
// Set the logging level for LOG() messages, based on the Apache log level and
77
 
// the VLOG-level specified in the server config.  Note that the VLOG level
78
 
// will be ignored unless the Apache log verbosity is at NOTICE or higher.
79
 
// Should be called once for each child process, at process startup.
80
 
void SetLoggingLevel(int apache_log_level, int vlog_level);
81
 
 
82
 
}  // namespace mod_spdy
83
 
 
84
 
#endif  // MOD_SPDY_APACHE_LOG_MESSAGE_HANDLER_H_