GunnyLog 1.1.0 → 1.1.1
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 +58 -1
- data/lib/GunnyLog/version.rb +1 -1
- 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: 17126527e62c41e8359897bce9ccb9d64bb35175
|
4
|
+
data.tar.gz: 64339a8b2c64d011b4b1818f9856a179c7f039b5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: db38606c708396652ba65a1e8055f20acc0a8fe057e638849db0e74a6422c7b555dce31ffd21bf0de745e2793e31adb9cf661dda14899ffb3a6b69deaec0a07f
|
7
|
+
data.tar.gz: 146f127c246604ee66fb3ade0ea3230625262c885e4fca9cd747cdd979c2898202fe654aa165bd7fd10e6ff09b06d742512ca2953cb6ef14f82e1249ce3e9ae7
|
data/README.md
CHANGED
@@ -20,7 +20,64 @@ Or install it yourself as:
|
|
20
20
|
|
21
21
|
## Usage
|
22
22
|
|
23
|
-
|
23
|
+
### Require GunnyLog
|
24
|
+
require 'GunnyLog'
|
25
|
+
|
26
|
+
### Example of screen logging, one liners
|
27
|
+
GunnyLog.instance.message('Main:Runloop', 'Error loading preferences')<br>
|
28
|
+
GunnyLog.instance.message_formatted('TestClass:GetUrl', 'Error number = %d', 40)<br>
|
29
|
+
|
30
|
+
### Example of screen logging
|
31
|
+
logs = GunnyLog.instance<br>
|
32
|
+
|
33
|
+
logs.message('Testing GunnyScreenLog 01')<br>
|
34
|
+
logs.set_logging_enabled(false)<br>
|
35
|
+
logs.message('Testing GunnyScreenLog 02 OFF')<br>
|
36
|
+
logs.set_logging_enabled(true)<br>
|
37
|
+
|
38
|
+
logs.set_message_location('init')<br>
|
39
|
+
logs.message('Testing GunnyScreenLog 01')<br>
|
40
|
+
logs.set_message_location('destroy')<br>
|
41
|
+
logs.message('Testing GunnyScreenLog 02')<br>
|
42
|
+
|
43
|
+
logs.message('read','Testing GunnyScreenLog 02')<br>
|
44
|
+
logs.message('sort','Testing GunnyScreenLog 03')<br>
|
45
|
+
|
46
|
+
logs.message_formatted('name: %s, age: %d, job: %s', ['Gunny', 42, 'Developer'])<br>
|
47
|
+
logs.message_formatted_vars(nil, 'name: %s, age: %d, job: %s', 'Gunny', 42, 'Developer')<br>
|
48
|
+
|
49
|
+
### Example of file logging
|
50
|
+
logf = GunnyLogFile.instance<br>
|
51
|
+
logf.open('testapp.log')<br>
|
52
|
+
|
53
|
+
logf.message('Testing GunnyFileLog 01')<br>
|
54
|
+
logf.set_logging_enabled(false)<br>
|
55
|
+
logf.message('Testing GunnyFileLog 02 OFF')<br>
|
56
|
+
logf.set_logging_enabled(true)<br>
|
57
|
+
|
58
|
+
logf.set_message_location('init')<br>
|
59
|
+
logf.message('Testing GunnyFileLog 01')<br>
|
60
|
+
logf.set_message_location('destroy')<br>
|
61
|
+
logf.message('Testing GunnyFileLog 02')<br>
|
62
|
+
|
63
|
+
logf.message('read','Testing GunnyFileLog 02')<br>
|
64
|
+
logf.message('sort','Testing GunnyFileLog 03')<br>
|
65
|
+
|
66
|
+
logf.message_formatted('name: %s, age: %d, job: %s', ['Gunny', 42, 'Developer'])<br>
|
67
|
+
logf.message_formatted_vars(nil, 'name: %s, age: %d, job: %s', 'Gunny', 42, 'Developer')<br>
|
68
|
+
|
69
|
+
logf.close<br>
|
70
|
+
|
71
|
+
### Sample output
|
72
|
+
09/11/2014|03:33:58PM|testapp01.rb|Main:Runloop|Error loading preferences<br>
|
73
|
+
09/11/2014|03:33:58PM|testapp01.rb|TestClass:GetUrl|Error number = 40<br>
|
74
|
+
09/11/2014|03:33:58PM|testapp01.rb|TestClass:GetUrl|Testing GunnyScreenLog 01<br>
|
75
|
+
09/11/2014|03:33:58PM|testapp01.rb|init|Testing GunnyScreenLog 01<br>
|
76
|
+
09/11/2014|03:33:58PM|testapp01.rb|destroy|Testing GunnyScreenLog 02<br>
|
77
|
+
09/11/2014|03:33:58PM|testapp01.rb|read|Testing GunnyScreenLog 02<br>
|
78
|
+
09/11/2014|03:33:58PM|testapp01.rb|sort|Testing GunnyScreenLog 03<br>
|
79
|
+
09/11/2014|03:33:58PM|testapp01.rb|sort|name: Gunny, age: 42, job: Developer<br>
|
80
|
+
09/11/2014|03:33:58PM|testapp01.rb|sort|name: Gunny, age: 42, job: Developer<br>
|
24
81
|
|
25
82
|
## Documentation
|
26
83
|
|
data/lib/GunnyLog/version.rb
CHANGED