justlogging 1.1.5 → 1.1.6
Sign up to get free protection for your applications and to get access to all the features.
- data/README.textile +24 -20
- data/lib/justlogging.rb +2 -2
- metadata +16 -4
data/README.textile
CHANGED
@@ -5,41 +5,45 @@ This plugin enables easy logging from any Ruby application to our webservice.
|
|
5
5
|
For other languages checkout:
|
6
6
|
* http://www.github.com/justlogging/php_logger
|
7
7
|
* http://www.github.com/justlogging/python_logger
|
8
|
+
* http://www.github.com/justlogging/perl_logger
|
8
9
|
|
9
10
|
h2. Install
|
10
11
|
|
11
12
|
Install it as a gem (on gemcutter):
|
12
|
-
|
13
|
-
<pre>
|
14
|
-
<code>
|
15
|
-
gem install justlogging
|
16
|
-
</code>
|
17
|
-
</pre>
|
13
|
+
@gem install justlogging@
|
18
14
|
|
19
15
|
For rails:
|
20
16
|
|
21
17
|
Add this to your enviroment.rb
|
22
|
-
|
23
|
-
|
24
|
-
config.gem "justlogging", :lib => 'justlogging'
|
25
|
-
</code>
|
26
|
-
</pre>
|
18
|
+
@config.gem "justlogging", :lib => 'justlogging'@
|
19
|
+
|
27
20
|
and run
|
28
|
-
<pre>
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
</code>
|
33
|
-
</pre>
|
21
|
+
<pre><code>
|
22
|
+
rake gems:install
|
23
|
+
script/generate justlogging
|
24
|
+
</code></pre>
|
34
25
|
|
35
26
|
The generator copies a file called @justlogging.rb@ to the @RAILS_ROOT/config/initializer@ directory. You need to set you api key there and optionally your default log key.
|
36
27
|
|
37
|
-
|
38
|
-
|
39
28
|
h2. Usage
|
40
29
|
|
30
|
+
Configuration (only needed if not used as rails gem)
|
31
|
+
<pre><code>
|
32
|
+
Justlogging.configure do |config|
|
33
|
+
config.api_key = 'api_key'
|
34
|
+
config.log_key = 'log_name'
|
35
|
+
end
|
36
|
+
</code></pre>
|
37
|
+
|
38
|
+
Normal log entry:
|
41
39
|
@Justlogging.log('this is my first entry')@
|
42
40
|
|
41
|
+
Alert
|
42
|
+
@Justlogging.alert('this is my first alert')@
|
43
|
+
|
44
|
+
Optional parameter for alert and log is the log you want to post to like:
|
45
|
+
@Justlogging.log('another log entry', 'messages')@
|
46
|
+
|
43
47
|
Easy as pie.
|
44
48
|
|
45
|
-
Copyright (c) 2009 Justlogging, released under the MIT license
|
49
|
+
Copyright (c) 2009 Justlogging, released under the MIT license
|
data/lib/justlogging.rb
CHANGED
@@ -5,7 +5,7 @@ require "net/http"
|
|
5
5
|
module Justlogging
|
6
6
|
|
7
7
|
class << self
|
8
|
-
attr_accessor :api_key, :log_key
|
8
|
+
attr_accessor :api_key, :log_key, :host
|
9
9
|
|
10
10
|
def logger
|
11
11
|
ActiveRecord::Base.logger
|
@@ -18,7 +18,7 @@ module Justlogging
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def url
|
21
|
-
URI.parse('http://logs.justlogging.com/log')
|
21
|
+
URI.parse(host.present? ? host : 'http://logs.justlogging.com/log')
|
22
22
|
end
|
23
23
|
|
24
24
|
def alert(entry, log_key = self.log_key)
|
metadata
CHANGED
@@ -1,7 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: justlogging
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
hash: 31
|
5
|
+
prerelease: false
|
6
|
+
segments:
|
7
|
+
- 1
|
8
|
+
- 1
|
9
|
+
- 6
|
10
|
+
version: 1.1.6
|
5
11
|
platform: ruby
|
6
12
|
authors:
|
7
13
|
- Robert Beekman
|
@@ -38,21 +44,27 @@ rdoc_options:
|
|
38
44
|
require_paths:
|
39
45
|
- lib
|
40
46
|
required_ruby_version: !ruby/object:Gem::Requirement
|
47
|
+
none: false
|
41
48
|
requirements:
|
42
49
|
- - ">="
|
43
50
|
- !ruby/object:Gem::Version
|
51
|
+
hash: 3
|
52
|
+
segments:
|
53
|
+
- 0
|
44
54
|
version: "0"
|
45
|
-
version:
|
46
55
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
56
|
+
none: false
|
47
57
|
requirements:
|
48
58
|
- - ">="
|
49
59
|
- !ruby/object:Gem::Version
|
60
|
+
hash: 3
|
61
|
+
segments:
|
62
|
+
- 0
|
50
63
|
version: "0"
|
51
|
-
version:
|
52
64
|
requirements: []
|
53
65
|
|
54
66
|
rubyforge_project:
|
55
|
-
rubygems_version: 1.3.
|
67
|
+
rubygems_version: 1.3.7
|
56
68
|
signing_key:
|
57
69
|
specification_version: 3
|
58
70
|
summary: justlogging is a justlogging API wrapper
|