GunnyLog 1.1.6 → 1.1.7

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 (4) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +7 -7
  3. data/lib/GunnyLog.rb +7 -8
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 20fd49a5983b4fedb2278ba64e8e3ed75f80fde7
4
- data.tar.gz: 642920643fa21c3251a999f4bac4d7fe5888cce3
3
+ metadata.gz: d5e65091b2e37448af238d5168caec2e07f58c1a
4
+ data.tar.gz: ee6d377abee58011a79ff61cfb34102a02f4e14a
5
5
  SHA512:
6
- metadata.gz: 50009f7ffbfa47e57c724f0d3cb6b383f85a9892f958b014a59894d51f32371357cbbab56f3642eb2ead110c4dc4d99ac3e01bd33378fa5670bc3fb0c15e5b93
7
- data.tar.gz: 649b1698678f24ef37470fd6d4e788e892dcc8ad2525adecd14568025ce9b72342bf2c3dfac61269006fc593d9ff6045fc9e0895194c74e13f7f9b69573b5524
6
+ metadata.gz: 5f611aa4909f74a053590008702e60fcad9aed0ba319751046c065747420d5386438f4126262ee11658743fd49efddb2aae5c366570f605d36017e3d84cc3077
7
+ data.tar.gz: cc69b6f0f7df8c24811c9a046e373f4147ec5698f59f0caccf99cf752154a3b5dcb8526f6910ebdc5fedbeab809be3ecd306534515b7941d5739b976e2355d42
data/README.md CHANGED
@@ -20,10 +20,10 @@ Or install it yourself as:
20
20
 
21
21
  ## Usage
22
22
 
23
- ### Require GunnyLog
23
+ ### GunnyLog Examples
24
24
  require 'GunnyLog'
25
25
 
26
- ### Example of screen logging, one liners
26
+ ### Example of STDOUT logging, one liners
27
27
 
28
28
  #### Sample code
29
29
  ```
@@ -42,7 +42,7 @@ GunnyLog.instance.message_formatted('Error number = %d', errno2)
42
42
  09/16/2014|01:27:30PM|testapp01.rb|TestClass:GetUrl|Error number = 22
43
43
  ```
44
44
 
45
- ### Example of screen logging
45
+ ### Example of STDOUT logging
46
46
 
47
47
  #### Sample code
48
48
  ```
@@ -53,9 +53,9 @@ logs.set_logging_enabled(false)
53
53
  logs.message('Testing GunnyScreenLog 02 OFF')
54
54
  logs.set_logging_enabled(true)
55
55
 
56
- logs.set_message_location('init')
56
+ logs.set_logging_location('init')
57
57
  logs.message('Testing GunnyScreenLog 01')
58
- logs.set_message_location('destroy')
58
+ logs.set_logging_location('destroy')
59
59
  logs.message('Testing GunnyScreenLog 02')
60
60
 
61
61
  logs.message('read','Testing GunnyScreenLog 02')
@@ -88,9 +88,9 @@ logf.set_logging_enabled(false)
88
88
  logf.message('Testing GunnyFileLog 02 OFF')
89
89
  logf.set_logging_enabled(true)
90
90
 
91
- logf.set_message_location('setup')
91
+ logf.set_logging_location('setup')
92
92
  logf.message('Testing GunnyFileLog 01')
93
- logf.set_message_location('destroy')
93
+ logf.set_logging_location('destroy')
94
94
  logf.message('Testing GunnyFileLog 02')
95
95
 
96
96
  logf.message('read','Testing GunnyFileLog 02')
@@ -63,13 +63,6 @@ class GunnyLog
63
63
  @logging_location = loc
64
64
  end
65
65
 
66
- # Set message was logged from message location
67
- # @param loc [string] message location name
68
- # @deprecated Use {#set_logging_location} instead
69
- def set_message_location(loc)
70
- @logging_location = loc
71
- end
72
-
73
66
  # Set output to STDOUT, default
74
67
  def set_output_stdout
75
68
  if @file_open
@@ -206,6 +199,12 @@ class GunnyLog
206
199
  log(UNKNOWN, loc, msg)
207
200
  end
208
201
 
202
+ # Instance method for GunnyLog
203
+ # @return [GunnyLog] instance
204
+ def self.instance
205
+ @@instance ||= new
206
+ end
207
+
209
208
  # private instance methods
210
209
  private
211
210
 
@@ -233,6 +232,7 @@ class GunnyLog
233
232
  end
234
233
  end
235
234
 
235
+ # log with level
236
236
  def log(sev, loc, msg)
237
237
  if loc == nil
238
238
  loc = @logging_location
@@ -244,7 +244,6 @@ class GunnyLog
244
244
  end
245
245
  end
246
246
 
247
-
248
247
  # get the date time stamp
249
248
  def date_str
250
249
  d = DateTime.now
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: GunnyLog
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.6
4
+ version: 1.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - GunnyHwy
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-09-13 00:00:00.000000000 Z
11
+ date: 2014-09-16 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Ruby class for logging to stdout, stderr, or a file
14
14
  email: gunnyhwy21@yahoo.com