prefixed-log-formatter 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.markdown +39 -0
- data/lib/prefixed-log-formatter/version.rb +1 -1
- data/prefixed-log-formatter.gemspec +1 -1
- metadata +5 -5
data/README.markdown
CHANGED
@@ -1 +1,40 @@
|
|
1
1
|
Log file lines should be prefixed with log level, timestamp, process id and an easy-to-grep "end of prefix" marker. This subclass of Logger::Formatter does those things.
|
2
|
+
|
3
|
+
## Example IRB Usage
|
4
|
+
|
5
|
+
# install gem
|
6
|
+
gem install prefixed-log-formatter
|
7
|
+
|
8
|
+
# from within irb
|
9
|
+
require 'rubygems'
|
10
|
+
require 'prefixed-log-formatter'
|
11
|
+
|
12
|
+
logger = Logger.new($stdout)
|
13
|
+
logger.formatter = PrefixedLogFormatter::Formatter.new
|
14
|
+
logger.debug 'hi'
|
15
|
+
|
16
|
+
## Example Rails usage
|
17
|
+
|
18
|
+
# add to your Gemfile
|
19
|
+
gem "prefixed-log-formatter"
|
20
|
+
|
21
|
+
# in config/application.rb
|
22
|
+
config.logger = Logger.new(config.paths.log.first)
|
23
|
+
config.log_level = Rails.env.production? ? Logger::INFO : Logger::DEBUG
|
24
|
+
config.logger.formatter = PrefixedLogFormatter::Formatter.new
|
25
|
+
|
26
|
+
# in your app
|
27
|
+
Rails.logger.debug 'debug'
|
28
|
+
Rails.logger.info 'info'
|
29
|
+
# etc...
|
30
|
+
|
31
|
+
## Customize the prefix separator
|
32
|
+
|
33
|
+
The default is ':::'
|
34
|
+
|
35
|
+
logger = Logger.new($stdout)
|
36
|
+
logger.formatter = PrefixedLogFormatter::Formatter.new
|
37
|
+
logger.formatter.prefix_separator = '--'
|
38
|
+
logger.debug 'hi'
|
39
|
+
# result:
|
40
|
+
# D 2012-03-05 15:18:58 28986 -- hi
|
@@ -7,7 +7,7 @@ Gem::Specification.new do |s|
|
|
7
7
|
s.version = PrefixedLogFormatter::VERSION
|
8
8
|
s.authors = ["Jordan Brough"]
|
9
9
|
s.email = ["jordan@animoto.com"]
|
10
|
-
s.homepage = "http://github.com/jordan-brough/prefixed-
|
10
|
+
s.homepage = "http://github.com/jordan-brough/prefixed-log-formatter"
|
11
11
|
s.summary = "Sensible and minimal log prefixng for Ruby apps"
|
12
12
|
s.description = %q{Log file lines should be prefixed with log level, timestamp, process id and an easy-to-grep "end of prefix" marker. This subclass of Logger::Formatter does those things.}
|
13
13
|
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: prefixed-log-formatter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 21
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 1.0.
|
9
|
+
- 1
|
10
|
+
version: 1.0.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Jordan Brough
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2012-03-
|
18
|
+
date: 2012-03-06 00:00:00 Z
|
19
19
|
dependencies: []
|
20
20
|
|
21
21
|
description: Log file lines should be prefixed with log level, timestamp, process id and an easy-to-grep "end of prefix" marker. This subclass of Logger::Formatter does those things.
|
@@ -35,7 +35,7 @@ files:
|
|
35
35
|
- lib/prefixed-log-formatter.rb
|
36
36
|
- lib/prefixed-log-formatter/version.rb
|
37
37
|
- prefixed-log-formatter.gemspec
|
38
|
-
homepage: http://github.com/jordan-brough/prefixed-
|
38
|
+
homepage: http://github.com/jordan-brough/prefixed-log-formatter
|
39
39
|
licenses: []
|
40
40
|
|
41
41
|
post_install_message:
|