clogger 2.0.2 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.olddoc.yml +9 -3
- data/GIT-VERSION-GEN +1 -1
- data/GNUmakefile +1 -1
- data/LICENSE +2 -3
- data/README +5 -5
- data/clogger.gemspec +1 -2
- data/ext/clogger_ext/blocking_helpers.h +5 -2
- data/ext/clogger_ext/clogger.c +2 -2
- data/lib/clogger/format.rb +2 -2
- data/lib/clogger/pure.rb +1 -1
- data/test/test_clogger.rb +2 -0
- metadata +11 -19
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7d599688759448c6bf0402ae0ffe376133f79caa
|
4
|
+
data.tar.gz: 87a801805a909d115597fd8fb89c839f81db9c59
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c77852c8b454f4e7b67c3c1de5701506d7196e6d9307a14808ba28e1c69b48032b37f03b6b9ef281821b5c35bf818214e7c5a25956e95d195c7f8ccda068c81a
|
7
|
+
data.tar.gz: 472bdd0b12d9d79d43ac97070c9daee1c156adf7eadb38c9d634a52cc6e72314f62dcf32d73bef4b9f6abbee387ef9603e90fd799ad1e3015023b897fbaafbaf
|
data/.olddoc.yml
CHANGED
@@ -1,7 +1,13 @@
|
|
1
1
|
---
|
2
|
-
rdoc_url:
|
3
|
-
cgit_url:
|
2
|
+
rdoc_url: https://bogomips.org/clogger/
|
3
|
+
cgit_url: https://bogomips.org/clogger.git
|
4
4
|
git_url: git://bogomips.org/clogger.git
|
5
5
|
public_email: clogger-public@bogomips.org
|
6
6
|
private_email: clogger@bogomips.org
|
7
|
-
ml_url:
|
7
|
+
ml_url:
|
8
|
+
- https://bogomips.org/clogger-public/
|
9
|
+
- http://ou63pmih66umazou.onion/clogger-public/
|
10
|
+
- nntp://news.public-inbox.org/inbox.comp.lang.ruby.clogger
|
11
|
+
source_code:
|
12
|
+
- git clone git://bogomips.org/clogger.git
|
13
|
+
- git clone https://bogomips.org/clogger.git
|
data/GIT-VERSION-GEN
CHANGED
data/GNUmakefile
CHANGED
data/LICENSE
CHANGED
@@ -3,7 +3,7 @@ revision control for names and email addresses of all of them.
|
|
3
3
|
|
4
4
|
You can redistribute it and/or modify it under the terms of the GNU
|
5
5
|
Lesser General Public License (LGPL) as published by the Free Software
|
6
|
-
Foundation, version {2.1}[
|
6
|
+
Foundation, version {2.1}[https://www.gnu.org/licenses/lgpl-2.1.txt] or
|
7
7
|
(at your option) any later version.
|
8
8
|
|
9
9
|
clogger is distributed in the hope that it will be useful, but WITHOUT
|
@@ -12,5 +12,4 @@ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
|
|
12
12
|
License for more details.
|
13
13
|
|
14
14
|
You should have received a copy of the GNU Lesser General Public License
|
15
|
-
along with this library; if not,
|
16
|
-
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
|
15
|
+
along with this library; if not, see https://www.gnu.org/licenses/
|
data/README
CHANGED
@@ -92,18 +92,18 @@ that receives a "<<" method:
|
|
92
92
|
|
93
93
|
== REQUIREMENTS
|
94
94
|
|
95
|
-
* {Ruby}[
|
95
|
+
* {Ruby}[https://www.ruby-lang.org/], {Rack}[https://rack.github.io/]
|
96
96
|
|
97
97
|
== DEVELOPMENT
|
98
98
|
|
99
99
|
The latest development happens in git and is published to the following:
|
100
100
|
|
101
|
-
git://bogomips.org/clogger.git
|
102
|
-
git://repo.or.cz/clogger.git
|
101
|
+
git clone git://bogomips.org/clogger.git
|
102
|
+
git clone git://repo.or.cz/clogger.git
|
103
103
|
|
104
104
|
You may also browse and download snapshot tarballs:
|
105
105
|
|
106
|
-
*
|
106
|
+
* https://bogomips.org/clogger.git
|
107
107
|
* http://repo.or.cz/w/clogger.git (gitweb)
|
108
108
|
|
109
109
|
The mailing list (see below) is central for coordination and
|
@@ -119,7 +119,7 @@ requests) go to the public mailing list.
|
|
119
119
|
|
120
120
|
Do not send HTML mail or attachments. Do not top post.
|
121
121
|
|
122
|
-
Homepage:
|
122
|
+
Homepage: https://bogomips.org/clogger/
|
123
123
|
|
124
124
|
== INSTALL
|
125
125
|
|
data/clogger.gemspec
CHANGED
@@ -17,8 +17,7 @@ Gem::Specification.new do |s|
|
|
17
17
|
s.test_files = %w(test/test_clogger.rb test/test_clogger_to_path.rb)
|
18
18
|
|
19
19
|
# HeaderHash wasn't case-insensitive in old versions
|
20
|
-
s.add_dependency(%q<rack>, [
|
21
|
-
s.add_development_dependency(%q<olddoc>, "~> 1.0")
|
20
|
+
s.add_dependency(%q<rack>, ['>= 1.0', '< 3.0'])
|
22
21
|
s.extensions = %w(ext/clogger_ext/extconf.rb)
|
23
22
|
|
24
23
|
s.licenses = %w(LGPL-2.1+)
|
@@ -54,6 +54,9 @@ static ssize_t my_write(int fd, const void *buf, size_t count)
|
|
54
54
|
|
55
55
|
return r;
|
56
56
|
}
|
57
|
-
# define
|
58
|
-
# define
|
57
|
+
# define nogvl_stat(path,buf) my_stat((path),(buf))
|
58
|
+
# define nogvl_write(fd,buf,count) my_write((fd),(buf),(count))
|
59
|
+
#else /* !WITHOUT_GVL, for Ruby 1.8 users: */
|
60
|
+
# define nogvl_stat(path,buf) stat((path),(buf))
|
61
|
+
# define nogvl_write(fd,buf,buf) write((fd),(buf),(count))
|
59
62
|
#endif /* !WITHOUT_GVL */
|
data/ext/clogger_ext/clogger.c
CHANGED
@@ -243,7 +243,7 @@ static void write_full(int fd, const char *buf, size_t count)
|
|
243
243
|
ssize_t r;
|
244
244
|
|
245
245
|
while (count > 0) {
|
246
|
-
r =
|
246
|
+
r = nogvl_write(fd, buf, count);
|
247
247
|
|
248
248
|
if ((size_t)r == count) { /* overwhelmingly likely */
|
249
249
|
return;
|
@@ -993,7 +993,7 @@ static VALUE to_path(VALUE self)
|
|
993
993
|
if (sscanf(cpath, "/dev/fd/%u", &devfd) == 1)
|
994
994
|
rv = fstat((int)devfd, &sb);
|
995
995
|
else
|
996
|
-
rv =
|
996
|
+
rv = nogvl_stat(cpath, &sb);
|
997
997
|
|
998
998
|
/*
|
999
999
|
* calling this method implies the web server will bypass
|
data/lib/clogger/format.rb
CHANGED
@@ -5,12 +5,12 @@ class Clogger
|
|
5
5
|
# predefined log formats in wide use
|
6
6
|
module Format
|
7
7
|
# common log format used by Apache:
|
8
|
-
#
|
8
|
+
# https://httpd.apache.org/docs/2.4/logs.html
|
9
9
|
Common = "$remote_addr - $remote_user [$time_local] " \
|
10
10
|
'"$request" $status $response_length'
|
11
11
|
|
12
12
|
# combined log format used by Apache:
|
13
|
-
#
|
13
|
+
# https://httpd.apache.org/docs/2.4/logs.html
|
14
14
|
Combined = %Q|#{Common} "$http_referer" "$http_user_agent"|
|
15
15
|
|
16
16
|
# combined log format used by nginx:
|
data/lib/clogger/pure.rb
CHANGED
data/test/test_clogger.rb
CHANGED
@@ -147,6 +147,7 @@ class TestClogger < Test::Unit::TestCase
|
|
147
147
|
req = {
|
148
148
|
'HTTP_HOST' => 'example.com:12345',
|
149
149
|
'HTTP_COOKIE' => cookie,
|
150
|
+
'REMOTE_USER' => 'foo_user',
|
150
151
|
}
|
151
152
|
req = @req.merge(req)
|
152
153
|
body = cl.call(req).last
|
@@ -154,6 +155,7 @@ class TestClogger < Test::Unit::TestCase
|
|
154
155
|
body.close
|
155
156
|
str = str.string
|
156
157
|
assert(str.size > 128)
|
158
|
+
assert_equal 'foo_user', str.split(' ')[2]
|
157
159
|
assert_match %r["echo and socat \\o/" "#{cookie}" \d+\.\d{3}], str
|
158
160
|
assert_match %r["#{cookie}" \d+\.\d{3} example\.com:12345\n\z], str
|
159
161
|
end
|
metadata
CHANGED
@@ -1,43 +1,35 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: clogger
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0
|
4
|
+
version: 2.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- cloggers
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-07-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rack
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '1.0'
|
20
|
+
- - "<"
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: '3.0'
|
20
23
|
type: :runtime
|
21
24
|
prerelease: false
|
22
25
|
version_requirements: !ruby/object:Gem::Requirement
|
23
26
|
requirements:
|
24
|
-
- - "
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: '1.0'
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: olddoc
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - "~>"
|
27
|
+
- - ">="
|
32
28
|
- !ruby/object:Gem::Version
|
33
29
|
version: '1.0'
|
34
|
-
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - "~>"
|
30
|
+
- - "<"
|
39
31
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
32
|
+
version: '3.0'
|
41
33
|
description: |-
|
42
34
|
clogger is Rack middleware for logging HTTP requests. The log format
|
43
35
|
is customizable so you can specify exactly which fields to log.
|
@@ -83,7 +75,7 @@ files:
|
|
83
75
|
- setup.rb
|
84
76
|
- test/test_clogger.rb
|
85
77
|
- test/test_clogger_to_path.rb
|
86
|
-
homepage:
|
78
|
+
homepage: https://bogomips.org/clogger/
|
87
79
|
licenses:
|
88
80
|
- LGPL-2.1+
|
89
81
|
metadata: {}
|
@@ -103,7 +95,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
103
95
|
version: '0'
|
104
96
|
requirements: []
|
105
97
|
rubyforge_project:
|
106
|
-
rubygems_version: 2.
|
98
|
+
rubygems_version: 2.6.6
|
107
99
|
signing_key:
|
108
100
|
specification_version: 4
|
109
101
|
summary: configurable request logging for Rack
|