customlogger 0.0.7 → 0.0.8
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.
- checksums.yaml +4 -4
- data/README.md +17 -2
- data/lib/customlogger.rb +1 -1
- data/lib/customlogger/html_template.rb +2 -2
- data/lib/customlogger/version.rb +1 -1
- data/spec/customlogger_spec.rb +7 -7
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b83205247923c4adfe9f0a6ab7b3ddd6247b130e
|
4
|
+
data.tar.gz: 991b7b21198ef829b72355c040b135a4230f56d1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5cd3178688ffad3d178bbb0934ebaab9053d803c841ef3da32cc838d47508ce3e499f8a3ca065fca5bb168643ee0fd1b32217067a30c24c84f52d44a887c0942
|
7
|
+
data.tar.gz: dcf6f31edfbef2a63f71a2a404515145b2441fc5a91445eb7b7dd2f4d11c7aa668e54f72429a6cf188bd7a222f4ca59752a5374c248473e4ac1f1dbb78d84792
|
data/README.md
CHANGED
@@ -23,7 +23,7 @@ group :development, :test do
|
|
23
23
|
[...]
|
24
24
|
end
|
25
25
|
```
|
26
|
-
Keep in mind that "[...]" means that there may or may not
|
26
|
+
Keep in mind that "[...]" means that there may or may not be other gems there.
|
27
27
|
|
28
28
|
And then execute:
|
29
29
|
|
@@ -36,7 +36,8 @@ Or install it yourself as:
|
|
36
36
|
## Usage
|
37
37
|
|
38
38
|
Custom Logger is very easy to use. Just use the module 'CustomLogger' anywhere
|
39
|
-
and log the message in a nice friendly colorful html page view.
|
39
|
+
and log the message in a nice friendly colorful html page view. All the logging
|
40
|
+
follows pattern of message input first followed by optional title. Take a look
|
40
41
|
at the examples below.
|
41
42
|
|
42
43
|

|
@@ -46,6 +47,7 @@ at the examples below.
|
|
46
47
|
CustomLogger.error 'This is an error message'
|
47
48
|
CustomLogger.error = 'This is an error message'
|
48
49
|
CustomLogger.error 'This is an error message', 'Error Title'
|
50
|
+
CustomLogger.error('This is an error message', 'Error Title')
|
49
51
|
|
50
52
|

|
51
53
|
|
@@ -54,6 +56,7 @@ at the examples below.
|
|
54
56
|
CustomLogger.warning 'This is a warning message'
|
55
57
|
CustomLogger.warning = 'This is a warning message'
|
56
58
|
CustomLogger.warning 'This is a warning message', 'Warning Title'
|
59
|
+
CustomLogger.warning('This is a warning message', 'Warning Title')
|
57
60
|
|
58
61
|

|
59
62
|
|
@@ -62,6 +65,7 @@ at the examples below.
|
|
62
65
|
CustomLogger.debug 'This is a debug message'
|
63
66
|
CustomLogger.debug = 'This is a debug message'
|
64
67
|
CustomLogger.debug 'This is a debug message', 'Debug Title'
|
68
|
+
CustomLogger.debug('This is a debug message', 'Debug Title')
|
65
69
|
|
66
70
|

|
67
71
|
|
@@ -70,6 +74,7 @@ at the examples below.
|
|
70
74
|
CustomLogger.info 'This is an info message'
|
71
75
|
CustomLogger.info = 'This is an info message'
|
72
76
|
CustomLogger.info 'This is an info message', 'Info Title'
|
77
|
+
CustomLogger.info('This is an info message', 'Info Title')
|
73
78
|
|
74
79
|

|
75
80
|
|
@@ -82,9 +87,19 @@ will see. Basically it is inside of a 'pre' html tag.
|
|
82
87
|
CustomLogger.raw 'This is a raw message'
|
83
88
|
CustomLogger.raw = 'This is a raw message'
|
84
89
|
CustomLogger.raw 'This is a raw message', 'Raw Title'
|
90
|
+
CustomLogger.raw('This is a raw message', 'Raw Title')
|
85
91
|
|
86
92
|

|
87
93
|
|
94
|
+
#### ActiveRecord Support
|
95
|
+
|
96
|
+
CustomLogger supports ActiveRecord if you use ActiveRecord. To log ActiveRecord
|
97
|
+
just use raw logger. For an example:
|
98
|
+
|
99
|
+
CustomLogger.raw(User.first, 'This is User.first')
|
100
|
+
|
101
|
+

|
102
|
+
|
88
103
|
#### New Line
|
89
104
|
|
90
105
|
If you want to add a gap in-between sets of outputs then this is what you are
|
data/lib/customlogger.rb
CHANGED
@@ -36,7 +36,7 @@ class HTMLTemplate
|
|
36
36
|
font-family: monospace, monospace, serif;
|
37
37
|
font-size: 0.9em;
|
38
38
|
color: #{error_colors[:warning]};
|
39
|
-
background-color: #
|
39
|
+
background-color: #ffeedc;
|
40
40
|
border-color: #b4a48a;
|
41
41
|
padding: 8px;
|
42
42
|
border: 1px solid #b4a48a;
|
@@ -60,7 +60,7 @@ class HTMLTemplate
|
|
60
60
|
font-family: monospace, monospace, serif;
|
61
61
|
font-size: 0.9em;
|
62
62
|
color: #{error_colors[:debug]};
|
63
|
-
background-color: #
|
63
|
+
background-color: #f8fbe2;
|
64
64
|
border-color: #bbcbad;
|
65
65
|
padding: 8px;
|
66
66
|
border: 1px solid #bbcbad;
|
data/lib/customlogger/version.rb
CHANGED
data/spec/customlogger_spec.rb
CHANGED
@@ -38,22 +38,22 @@ describe 'with Custom Logger' do
|
|
38
38
|
describe 'with error colors' do
|
39
39
|
it 'will have default error colors' do
|
40
40
|
expect( CustomLogger.error_colors
|
41
|
-
).to eq ({ error: '#8b0000', warning: '#6d422e', debug: '#
|
42
|
-
info: '#
|
41
|
+
).to eq ({ error: '#8b0000', warning: '#6d422e', debug: '#ececec',
|
42
|
+
info: '#285b75' })
|
43
43
|
end
|
44
44
|
|
45
45
|
it 'will allow to set error color' do
|
46
46
|
CustomLogger.error_color(:error, 'lovell')
|
47
47
|
expect( CustomLogger.error_colors
|
48
|
-
).to eq ({ error: 'lovell', warning: '#6d422e', debug: '#
|
49
|
-
info: '#
|
48
|
+
).to eq ({ error: 'lovell', warning: '#6d422e', debug: '#ececec',
|
49
|
+
info: '#285b75' })
|
50
50
|
end
|
51
51
|
|
52
52
|
it 'will allow to set warning color' do
|
53
53
|
CustomLogger.error_color(:warning, 'slovell')
|
54
54
|
expect( CustomLogger.error_colors
|
55
|
-
).to eq ({ error: 'lovell', warning: 'slovell', debug: '#
|
56
|
-
info: '#
|
55
|
+
).to eq ({ error: 'lovell', warning: 'slovell', debug: '#ececec',
|
56
|
+
info: '#285b75' })
|
57
57
|
end
|
58
58
|
|
59
59
|
it 'will allow to set debug color' do
|
@@ -61,7 +61,7 @@ describe 'with Custom Logger' do
|
|
61
61
|
expect( CustomLogger.error_colors
|
62
62
|
|
63
63
|
).to eq ({ error: 'lovell', warning: 'slovell', debug: 'saimon',
|
64
|
-
info: '#
|
64
|
+
info: '#285b75' })
|
65
65
|
end
|
66
66
|
|
67
67
|
it 'will allow to set debug color' do
|