scribe 0.1 → 0.1.1
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.
- data.tar.gz.sig +0 -0
- data/CHANGELOG +2 -0
- data/lib/scribe/scribe.rb +10 -0
- data/scribe.gemspec +1 -1
- metadata +1 -1
- metadata.gz.sig +0 -0
data.tar.gz.sig
CHANGED
Binary file
|
data/CHANGELOG
CHANGED
data/lib/scribe/scribe.rb
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
|
2
2
|
class Scribe
|
3
|
+
# Created a new client instance. Accepts an optional host, port, and default
|
4
|
+
# category.
|
3
5
|
def initialize(host = "127.0.0.1", port = 1463, category = "Ruby")
|
4
6
|
@host = host
|
5
7
|
@port = port
|
@@ -13,6 +15,7 @@ class Scribe
|
|
13
15
|
transport)
|
14
16
|
end
|
15
17
|
|
18
|
+
# Log a message. Accepts a string and an optional category.
|
16
19
|
def log(message, category = @category)
|
17
20
|
raise ArgumentError, "Message must be a string" unless message.is_a?(String)
|
18
21
|
raise ArgumentError, "Category must be a string" unless category.is_a?(String)
|
@@ -21,6 +24,7 @@ class Scribe
|
|
21
24
|
@batch ? @batch << entry : @client.Log(Array(entry))
|
22
25
|
end
|
23
26
|
|
27
|
+
# Batch several calls to Scribe#log together. Yields to a block.
|
24
28
|
def batch
|
25
29
|
@batch = []
|
26
30
|
yield
|
@@ -28,4 +32,10 @@ class Scribe
|
|
28
32
|
ensure
|
29
33
|
@batch = nil
|
30
34
|
end
|
35
|
+
|
36
|
+
alias :debug :log
|
37
|
+
alias :error :log
|
38
|
+
alias :fatal :log
|
39
|
+
alias :info :log
|
40
|
+
alias :warn :log
|
31
41
|
end
|
data/scribe.gemspec
CHANGED
metadata
CHANGED
metadata.gz.sig
CHANGED
Binary file
|