sixarm_ruby_pro_logger 2.0.0 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/README.md +45 -42
- data/VERSION +1 -1
- data/lib/sixarm_ruby_pro_logger.rb +12 -9
- metadata +2 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4ccb679d6502059d2e3b109b7dd77908ed632e64
|
4
|
+
data.tar.gz: 6a6358755e8be6ea34fd6c8474b155e509a6777a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2f1783453e1777bf49be337ddbedb2edd676f903e26235702da314958ec03b8e4e23d92f4085f3a94eb80517df975af30250aee8936b39cf36a801abb0a433a1
|
7
|
+
data.tar.gz: 223e0554d1d2601e54ef14d8f467aa66f1d564c25a79f7cd4113e058f821947c2ed87883d5f4090162070ec25f757ab8882eb1009fe64fbdf426241a7031d119
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/README.md
CHANGED
@@ -10,11 +10,12 @@
|
|
10
10
|
|
11
11
|
ProLogger is a custom logger formatter for Rails that prints these:
|
12
12
|
|
13
|
-
* Time stamp
|
14
|
-
*
|
15
|
-
*
|
16
|
-
*
|
17
|
-
*
|
13
|
+
* Time stamp: such as ISO 8601 format using YYYY-MM-DD and HH:MM:SS.
|
14
|
+
* Program name: such as `$PROGRAM_NAME`
|
15
|
+
* Hostname: such as `Socket.gethostname`.
|
16
|
+
* Process Id: such as `Process.pid`.
|
17
|
+
* Severity: such as debug, info, warn, error, and fatal.
|
18
|
+
* Message: a string, exception, array, or any object that has a `inspect` method
|
18
19
|
|
19
20
|
Example setup:
|
20
21
|
|
@@ -25,38 +26,6 @@ Example use:
|
|
25
26
|
logger.info("Hello")
|
26
27
|
=> "2011-12-31T12:59:59Z my_program my.example.com 1000 Hello"
|
27
28
|
|
28
|
-
For docs go to <http://sixarm.com/sixarm_ruby_pro_logger/doc>
|
29
|
-
|
30
|
-
Want to help? We're happy to get pull requests.
|
31
|
-
|
32
|
-
|
33
|
-
## Install quickstart
|
34
|
-
|
35
|
-
Install:
|
36
|
-
|
37
|
-
gem install sixarm_ruby_pro_logger
|
38
|
-
|
39
|
-
Bundler:
|
40
|
-
|
41
|
-
gem "sixarm_ruby_pro_logger", "~>2.0.0"
|
42
|
-
|
43
|
-
Require:
|
44
|
-
|
45
|
-
require "sixarm_ruby_pro_logger"
|
46
|
-
|
47
|
-
|
48
|
-
## Install with security (optional)
|
49
|
-
|
50
|
-
To enable high security for all our gems:
|
51
|
-
|
52
|
-
wget http://sixarm.com/sixarm.pem
|
53
|
-
gem cert --add sixarm.pem
|
54
|
-
gem sources --add http://sixarm.com
|
55
|
-
|
56
|
-
To install with high security:
|
57
|
-
|
58
|
-
gem install sixarm_ruby_pro_logger --test --trust-policy HighSecurity
|
59
|
-
|
60
29
|
|
61
30
|
## Options
|
62
31
|
|
@@ -74,14 +43,14 @@ Intialize options:
|
|
74
43
|
* pid: The process id number.
|
75
44
|
Default is `Process.pid`.
|
76
45
|
|
77
|
-
* message_separator:
|
78
|
-
Default is "
|
46
|
+
* message_separator: Print this between mutiple messages.
|
47
|
+
Default is "\n".
|
79
48
|
|
80
49
|
* backtrace_separator: Print this between exception backtrace lines.
|
81
|
-
Default is "
|
50
|
+
Default is "\n".
|
82
51
|
|
83
|
-
* line_separator:
|
84
|
-
Default is "
|
52
|
+
* line_separator: Print this between message lines.
|
53
|
+
Default is "\n", which is the same as no change.
|
85
54
|
|
86
55
|
Example:
|
87
56
|
|
@@ -104,6 +73,39 @@ The message can be:
|
|
104
73
|
* an array of messages: print the items in the array, separated by message_separator.
|
105
74
|
|
106
75
|
* any object: first convert it to a string using object.inspect, then print it as a string as above.
|
76
|
+
|
77
|
+
For docs go to <http://sixarm.com/sixarm_ruby_pro_logger/doc>
|
78
|
+
|
79
|
+
Want to help? We're happy to get pull requests.
|
80
|
+
|
81
|
+
|
82
|
+
## Install quickstart
|
83
|
+
|
84
|
+
Install:
|
85
|
+
|
86
|
+
gem install sixarm_ruby_pro_logger
|
87
|
+
|
88
|
+
Bundler:
|
89
|
+
|
90
|
+
gem "sixarm_ruby_pro_logger", "~>2.0.1"
|
91
|
+
|
92
|
+
Require:
|
93
|
+
|
94
|
+
require "sixarm_ruby_pro_logger"
|
95
|
+
|
96
|
+
|
97
|
+
## Install with security (optional)
|
98
|
+
|
99
|
+
To enable high security for all our gems:
|
100
|
+
|
101
|
+
wget http://sixarm.com/sixarm.pem
|
102
|
+
gem cert --add sixarm.pem
|
103
|
+
gem sources --add http://sixarm.com
|
104
|
+
|
105
|
+
To install with high security:
|
106
|
+
|
107
|
+
gem install sixarm_ruby_pro_logger --test --trust-policy HighSecurity
|
108
|
+
|
107
109
|
|
108
110
|
|
109
111
|
## Thanks
|
@@ -114,6 +116,7 @@ https://github.com/topfunky/hodel_3000_compliant_logger/
|
|
114
116
|
|
115
117
|
## Changes
|
116
118
|
|
119
|
+
* 2014-03-16 2.0.1 Change defaults to use newlines for readability
|
117
120
|
* 2014-03-15 2.0.0 Upgrades to be a formatter plus new options
|
118
121
|
* 2012-03-14 1.1.0 Update docs, tests
|
119
122
|
* 2011-11-27 1.0.0 Publish
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.0.
|
1
|
+
2.0.1
|
@@ -31,14 +31,14 @@ class ProLogger < Logger
|
|
31
31
|
# * pid: The process id number.
|
32
32
|
# Default is `Process.pid`.
|
33
33
|
#
|
34
|
-
# * message_separator:
|
35
|
-
# Default is "
|
34
|
+
# * message_separator: Print this between mutiple messages.
|
35
|
+
# Default is "\n".
|
36
36
|
#
|
37
37
|
# * backtrace_separator: Print this between exception backtrace lines.
|
38
|
-
# Default is "
|
38
|
+
# Default is "\n".
|
39
39
|
#
|
40
|
-
# * line_separator:
|
41
|
-
# Default is "
|
40
|
+
# * line_separator: Print this between message lines.
|
41
|
+
# Default is "\n", which is the same as no change.
|
42
42
|
#
|
43
43
|
# @param [Hash] options
|
44
44
|
#
|
@@ -47,9 +47,9 @@ class ProLogger < Logger
|
|
47
47
|
@progname = (options[:progname] || $PROGRAM_NAME).to_s
|
48
48
|
@hostname = (options[:hostname] || (require('socket') && Socket.gethostname)).to_s
|
49
49
|
@pid = (options[:pid] || Process.pid).to_s
|
50
|
-
@message_separator = (options[:message_separator] || "
|
51
|
-
@backtrace_separator = (options[:backtrace_separator] || "
|
52
|
-
@line_separator = (options[:line_separator] || "
|
50
|
+
@message_separator = (options[:message_separator] || "\n").to_s
|
51
|
+
@backtrace_separator = (options[:backtrace_separator] || "\n").to_s
|
52
|
+
@line_separator = (options[:line_separator] || "\n").to_s
|
53
53
|
end
|
54
54
|
|
55
55
|
# Call the formatter.
|
@@ -94,7 +94,10 @@ class ProLogger < Logger
|
|
94
94
|
else
|
95
95
|
message_string_when_object(msg)
|
96
96
|
end
|
97
|
-
|
97
|
+
if line_separator && line_separator != "\n"
|
98
|
+
s = s.gsub!(/\n/, line_separator)
|
99
|
+
end
|
100
|
+
return s.lstrip
|
98
101
|
end
|
99
102
|
|
100
103
|
def message_string_when_string(msg)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sixarm_ruby_pro_logger
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- SixArm
|
@@ -30,7 +30,7 @@ cert_chain:
|
|
30
30
|
sWRVEyjnjnNuAeLP9zv43IDXjS22L2efhap7IOinYjcecpfXJgQaU+6BFAY4sdkQ
|
31
31
|
S1STYSfs3qySBxxAeEyZTw==
|
32
32
|
-----END CERTIFICATE-----
|
33
|
-
date: 2014-03-
|
33
|
+
date: 2014-03-18 00:00:00.000000000 Z
|
34
34
|
dependencies: []
|
35
35
|
description: Logs more information than the typical Ruby logger.
|
36
36
|
email: sixarm@sixarm.com
|
metadata.gz.sig
CHANGED
Binary file
|