customlogger 0.0.4 → 0.0.5

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cdb6d168912b31deb497b06100850657aa2212c8
4
- data.tar.gz: 14187ae5e0c64aed6a9f0ad9dee2d851d6512555
3
+ metadata.gz: a7f7cadee874eef29a8a603afa95eb5388a7494b
4
+ data.tar.gz: 41cd2f51977bce9c266d6800b9602800ada0bada
5
5
  SHA512:
6
- metadata.gz: c155006f57e305297411cbd6b4601aef9b0b52eef799567f7634f77fb873093495721bf7df13260ccd4a861258d7fdaaadc49f611d1986e012d89193b99e4536
7
- data.tar.gz: 7009f330a686f3b2a25c8a1a9d8c7e983dafca5905fcaec4c6835794da40d2d195b9933136d67697abd289ef6ab5067a826707fbb0f9dfa5635038da258d47d8
6
+ metadata.gz: 706c05805cdae0ab622e339b259ce4a42b1f9e9defc116863dcd704a6b38b45ce6f7d53a21d2dea961dadb239bc1189d4e48fa8613e1e30bda3acbd7706cc8f8
7
+ data.tar.gz: f281c61f0dfa484b44733a4002f03db3e6f4ca634727f72d3f145f711895662040b9508ad3b85afeb762af51deb5195e0e05f7160eb41d92a77179bbdc3ac4db
data/.travis.yml CHANGED
@@ -1,4 +1,6 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.1.0
3
+ - 2.2
4
+ - 2.1
5
+ - 2.0.0
4
6
  - 1.9.3
data/README.md CHANGED
@@ -3,13 +3,13 @@
3
3
  [![Gem Version](https://badge.fury.io/rb/customlogger.png)](http://badge.fury.io/rb/customlogger)
4
4
  [![Build Status](https://travis-ci.org/SaimonL/CustomLogger.svg)](https://travis-ci.org/SaimonL/CustomLogger)
5
5
 
6
- Custom logger allows you to log you're debug infmration to an html file so you can
7
- view them in much more easier way. This is my first gem so expect things not
8
- to be perfect.
6
+ Custom logger allows you to log you're debug information to an html file so you can
7
+ view them in much more easier way. All you need to do is include the gem in the
8
+ Gemfile and then use it directly CustomLogger.
9
9
 
10
10
  ## Compatable
11
11
 
12
- CustomLogger is compatable with Ruby 1.9 and above. As for Rails 3.x and up.
12
+ CustomLogger is compatible with Ruby 1.9 and above. As for Rails 3.x and up.
13
13
  You should not be using or have Ruby 1.8 installed for obvious reasons.
14
14
 
15
15
  ## Installation
@@ -36,7 +36,7 @@ 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 view friendly coloful html page. Take a look
39
+ and log the message in a nice friendly colorful html page view. Take a look
40
40
  at the examples below.
41
41
 
42
42
  ![Example Screenshot](https://raw.githubusercontent.com/SaimonL/repo-assets/master/customlogger/all.png)
@@ -51,17 +51,17 @@ at the examples below.
51
51
 
52
52
  #### Log warning
53
53
 
54
- CustomLogger.warning 'This is an warning message'
55
- CustomLogger.warning = 'This is an warning message'
56
- CustomLogger.warning 'This is an warning message', 'Warning Title'
54
+ CustomLogger.warning 'This is a warning message'
55
+ CustomLogger.warning = 'This is a warning message'
56
+ CustomLogger.warning 'This is a warning message', 'Warning Title'
57
57
 
58
58
  ![Warning Screenshot](https://raw.githubusercontent.com/SaimonL/repo-assets/master/customlogger/warning.png)
59
59
 
60
60
  #### Log debug
61
61
 
62
- CustomLogger.debug 'This is an debug message'
63
- CustomLogger.debug = 'This is an debug message'
64
- CustomLogger.debug 'This is an debug message', 'Debug Title'
62
+ CustomLogger.debug 'This is a debug message'
63
+ CustomLogger.debug = 'This is a debug message'
64
+ CustomLogger.debug 'This is a debug message', 'Debug Title'
65
65
 
66
66
  ![Debug Screenshot](https://raw.githubusercontent.com/SaimonL/repo-assets/master/customlogger/debug.png)
67
67
 
@@ -79,16 +79,24 @@ Keep in mind that raw means that no formatting is applied so if the output
79
79
  is 1000 characters horizontal without any line break then that is what you
80
80
  will see. Basically it is inside of a 'pre' html tag.
81
81
 
82
- CustomLogger.raw 'This is an raw message'
83
- CustomLogger.raw = 'This is an raw message'
84
- CustomLogger.raw 'This is an raw message', 'Raw Title'
82
+ CustomLogger.raw 'This is a raw message'
83
+ CustomLogger.raw = 'This is a raw message'
84
+ CustomLogger.raw 'This is a raw message', 'Raw Title'
85
85
 
86
86
  ![Raw Screenshot](https://raw.githubusercontent.com/SaimonL/repo-assets/master/customlogger/raw.png)
87
87
 
88
- #### Clear All Logs
88
+ #### New Line
89
+
90
+ If you want to add a gap in-between sets of outputs then this is what you are
91
+ looking for.
92
+
93
+ CustomLogger.new_line
89
94
 
90
- customlogger.clear
95
+ ![New Line](https://raw.githubusercontent.com/SaimonL/repo-assets/master/customlogger/new_line.png)
96
+
97
+ #### Clear All Logs
91
98
 
99
+ CustomLogger.clear
92
100
 
93
101
  ## Log File
94
102
 
data/lib/customlogger.rb CHANGED
@@ -107,7 +107,7 @@ module CustomLogger
107
107
  private
108
108
  def set_error_colors
109
109
  @error_colors = {
110
- error: '#8b0000', warning: '#614c29',
110
+ error: '#8b0000', warning: '#6d422e',
111
111
  debug: '#2d5a2e', info: '#31708f'
112
112
  }
113
113
  end
@@ -119,6 +119,14 @@ module CustomLogger
119
119
  end
120
120
 
121
121
  def log(state, message, title = nil)
122
+ if !title.nil? && !title.is_a?(String)
123
+ title = title.inspect
124
+ end
125
+
126
+ unless %w(Array Hash String).include?(message.class.name)
127
+ message = message.inspect
128
+ end
129
+
122
130
  if @logged_total.nil?
123
131
  @logged_total = 0
124
132
  else
@@ -36,10 +36,10 @@ class HTMLTemplate
36
36
  font-family: monospace, monospace, serif;
37
37
  font-size: 0.9em;
38
38
  color: #{error_colors[:warning]};
39
- background-color: #fcf8e3;
40
- border-color: #faebcc;
39
+ background-color: #faebcc;
40
+ border-color: #b4a48a;
41
41
  padding: 8px;
42
- border: 1px solid #faebcc;
42
+ border: 1px solid #b4a48a;
43
43
  border-radius: 4px;
44
44
  margin-bottom: 4px;
45
45
  }
@@ -1,3 +1,3 @@
1
1
  module Customlogger
2
- VERSION = '0.0.4'
2
+ VERSION = '0.0.5'
3
3
  end
@@ -38,14 +38,14 @@ 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: '#614c29', debug: '#2d5a2e',
41
+ ).to eq ({ error: '#8b0000', warning: '#6d422e', debug: '#2d5a2e',
42
42
  info: '#31708f' })
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: '#614c29', debug: '#2d5a2e',
48
+ ).to eq ({ error: 'lovell', warning: '#6d422e', debug: '#2d5a2e',
49
49
  info: '#31708f' })
50
50
  end
51
51
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: customlogger
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Saimon Lovell
@@ -95,7 +95,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
95
95
  version: '0'
96
96
  requirements: []
97
97
  rubyforge_project:
98
- rubygems_version: 2.4.4
98
+ rubygems_version: 2.4.5
99
99
  signing_key:
100
100
  specification_version: 4
101
101
  summary: Log output in to a seperate html file.