cabin 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/LICENSE +14 -0
- data/examples/fib.rb +24 -0
- metadata +52 -32
data/LICENSE
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
Copyright 2011 Jordan Sissel
|
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
|
+
|
data/examples/fib.rb
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
require "rubygems"
|
2
|
+
require "cabin"
|
3
|
+
require "logger"
|
4
|
+
|
5
|
+
# Logging::... is something I'm implemented and experimenting with.
|
6
|
+
@logger = Cabin::Channel.new
|
7
|
+
|
8
|
+
# A logging channel can have any number of subscribers.
|
9
|
+
# Any subscriber is simply expected to respond to '<<' and take a single
|
10
|
+
# argument (the event)
|
11
|
+
# Special case of stdlib Logger instances that are wrapped smartly to
|
12
|
+
# log JSON and call the right Logger method (Logger#info, etc).
|
13
|
+
@logger.subscribe(Logger.new(STDOUT))
|
14
|
+
|
15
|
+
# You can store arbitrary key-value pairs in the logging channel.
|
16
|
+
# These are emitted with every event.
|
17
|
+
|
18
|
+
n = 30
|
19
|
+
@logger[:input] = n
|
20
|
+
@logger.time("fibonacci latency") do
|
21
|
+
#fib(30)
|
22
|
+
sleep(rand*2)
|
23
|
+
end
|
24
|
+
|
metadata
CHANGED
@@ -1,35 +1,45 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: cabin
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 0
|
7
|
+
- 1
|
8
|
+
- 1
|
9
|
+
version: 0.1.1
|
6
10
|
platform: ruby
|
7
|
-
authors:
|
11
|
+
authors:
|
8
12
|
- Jordan Sissel
|
9
13
|
autorequire:
|
10
14
|
bindir: bin
|
11
15
|
cert_chain: []
|
12
|
-
|
13
|
-
|
14
|
-
|
16
|
+
|
17
|
+
date: 2011-10-11 00:00:00 -07:00
|
18
|
+
default_executable:
|
19
|
+
dependencies:
|
20
|
+
- !ruby/object:Gem::Dependency
|
15
21
|
name: json
|
16
|
-
|
22
|
+
prerelease: false
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
17
24
|
none: false
|
18
|
-
requirements:
|
19
|
-
- -
|
20
|
-
- !ruby/object:Gem::Version
|
21
|
-
|
25
|
+
requirements:
|
26
|
+
- - ">="
|
27
|
+
- !ruby/object:Gem::Version
|
28
|
+
segments:
|
29
|
+
- 0
|
30
|
+
version: "0"
|
22
31
|
type: :runtime
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
consumable. Plain text logs are bullshit, let's emit structured and contextual logs.
|
27
|
-
email:
|
32
|
+
version_requirements: *id001
|
33
|
+
description: This is an experiment to try and make logging more flexible and more consumable. Plain text logs are bullshit, let's emit structured and contextual logs.
|
34
|
+
email:
|
28
35
|
- jls@semicomplete.com
|
29
36
|
executables: []
|
37
|
+
|
30
38
|
extensions: []
|
39
|
+
|
31
40
|
extra_rdoc_files: []
|
32
|
-
|
41
|
+
|
42
|
+
files:
|
33
43
|
- lib/cabin.rb
|
34
44
|
- lib/cabin/outputs/stdlib-logger.rb
|
35
45
|
- lib/cabin/channel.rb
|
@@ -37,34 +47,44 @@ files:
|
|
37
47
|
- lib/cabin/timer.rb
|
38
48
|
- lib/cabin/context.rb
|
39
49
|
- lib/cabin/logger.rb
|
50
|
+
- examples/fib.rb
|
40
51
|
- examples/sinatra-logging.rb
|
41
52
|
- examples/sample.rb
|
42
53
|
- test/minitest-patch.rb
|
43
54
|
- test/test_logging.rb
|
55
|
+
- LICENSE
|
56
|
+
has_rdoc: true
|
44
57
|
homepage: https://github.com/jordansissel/ruby-cabin
|
45
|
-
licenses:
|
58
|
+
licenses:
|
46
59
|
- Apache License (2.0)
|
47
60
|
post_install_message:
|
48
61
|
rdoc_options: []
|
49
|
-
|
62
|
+
|
63
|
+
require_paths:
|
50
64
|
- lib
|
51
65
|
- lib
|
52
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
66
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
53
67
|
none: false
|
54
|
-
requirements:
|
55
|
-
- -
|
56
|
-
- !ruby/object:Gem::Version
|
57
|
-
|
58
|
-
|
68
|
+
requirements:
|
69
|
+
- - ">="
|
70
|
+
- !ruby/object:Gem::Version
|
71
|
+
segments:
|
72
|
+
- 0
|
73
|
+
version: "0"
|
74
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
59
75
|
none: false
|
60
|
-
requirements:
|
61
|
-
- -
|
62
|
-
- !ruby/object:Gem::Version
|
63
|
-
|
76
|
+
requirements:
|
77
|
+
- - ">="
|
78
|
+
- !ruby/object:Gem::Version
|
79
|
+
segments:
|
80
|
+
- 0
|
81
|
+
version: "0"
|
64
82
|
requirements: []
|
83
|
+
|
65
84
|
rubyforge_project:
|
66
|
-
rubygems_version: 1.
|
85
|
+
rubygems_version: 1.3.7
|
67
86
|
signing_key:
|
68
87
|
specification_version: 3
|
69
88
|
summary: Experiments in structured and contextual logging
|
70
89
|
test_files: []
|
90
|
+
|