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.
- checksums.yaml +4 -4
- data/README.md +7 -7
- data/lib/GunnyLog.rb +7 -8
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d5e65091b2e37448af238d5168caec2e07f58c1a
|
4
|
+
data.tar.gz: ee6d377abee58011a79ff61cfb34102a02f4e14a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
###
|
23
|
+
### GunnyLog Examples
|
24
24
|
require 'GunnyLog'
|
25
25
|
|
26
|
-
### Example of
|
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
|
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.
|
56
|
+
logs.set_logging_location('init')
|
57
57
|
logs.message('Testing GunnyScreenLog 01')
|
58
|
-
logs.
|
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.
|
91
|
+
logf.set_logging_location('setup')
|
92
92
|
logf.message('Testing GunnyFileLog 01')
|
93
|
-
logf.
|
93
|
+
logf.set_logging_location('destroy')
|
94
94
|
logf.message('Testing GunnyFileLog 02')
|
95
95
|
|
96
96
|
logf.message('read','Testing GunnyFileLog 02')
|
data/lib/GunnyLog.rb
CHANGED
@@ -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.
|
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-
|
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
|