itslog 0.3.0 → 0.3.2

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.
Files changed (3) hide show
  1. data/README.md +61 -3
  2. data/lib/itslog/version.rb +1 -1
  3. metadata +3 -3
data/README.md CHANGED
@@ -5,11 +5,11 @@ itslog
5
5
 
6
6
  The formatting will prepend all log statements with a colored header and additional information about the statement.
7
7
 
8
- [timestamp] [rails namespace]: [normal log], example:
8
+ [timestamp] [rails namespace] [log message], example:
9
9
 
10
- 15:16:32 action_view: Rendered layouts/_head.haml (8.5ms)
10
+ 15:16:32 action_view Rendered layouts/_head.haml (8.5ms)
11
11
 
12
- In addition to more readable logs you can tail and grep specific parts of your application. example:
12
+ In addition to more readable logs, you can tail and grep specific parts of your application. example:
13
13
 
14
14
  tail -f log/development.log | grep active_record
15
15
 
@@ -24,7 +24,65 @@ Add to your Gemfile in Rails:
24
24
  gem 'itslog'
25
25
  end
26
26
 
27
+ Configure
28
+ -----------
29
+
30
+ Itslog does not need to be configured unless you want to customize the output structure and color.
31
+
32
+ Example:
33
+
34
+ Itslog.configure do |config|
35
+ config.namespace_colors = {
36
+ 'action_controller' => "\e[32m",
37
+ 'active_record' => "\e[94m",
38
+ 'action_view' => "\e[36m"
39
+ }
40
+ config.format = "Its log log log || %t [ %n ] %m \n by blamo"
41
+ end
42
+
43
+ Configure format by building a string anyway you'd like and using the following variables:
44
+
45
+ %t (timestamp)
46
+ %n (namespace)
47
+ %m (log message)
48
+
49
+ I don't recommend coloring by severity because it's not very useful. To color by severity instead of the default of namespace:
50
+
51
+ Itslog.configure do |config|
52
+ config.color_by :severity
53
+ config.severity_colors = ["\e[36m","\e[32m","\e[33m","\e[31m","\e[31m","\e[37m"]
54
+ # debug, info, warning, error, fatal, unknown
55
+ end
56
+
57
+ Place the configuration in an initializer:
58
+
59
+ config/initializers/itslog.rb
60
+
27
61
  Reference
28
62
  -------------
29
63
 
64
+ An example set of ANSI colors:
65
+
66
+ \e[30m grey
67
+ \e[31m red
68
+ \e[32m green
69
+ \e[33m yellow
70
+ \e[34m purple
71
+ \e[35m pink
72
+ \e[36m cyan
73
+ \e[37m white
74
+
75
+ \e[90m light grey
76
+ \e[91m light red
77
+ \e[92m light green
78
+ \e[93m light yellow
79
+ \e[94m light purple
80
+ \e[95m light pink
81
+ \e[96m light cyan
82
+
30
83
  All additional information can be found in this video: [The Log Song](http://nicktoons.nick.com/videos/clip/stimpys-big-day-log-song-1.html)
84
+
85
+ Contact
86
+ -----------
87
+
88
+ Please message me through github if you have any feature requests or issues. Thank you for all your feedback so far.
@@ -1,3 +1,3 @@
1
1
  module Itslog
2
- VERSION = '0.3.0'
2
+ VERSION = '0.3.2'
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: itslog
3
3
  version: !ruby/object:Gem::Version
4
- hash: 19
4
+ hash: 23
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 3
9
- - 0
10
- version: 0.3.0
9
+ - 2
10
+ version: 0.3.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - John Thomas Marino