GunnyLog 1.0.8 → 1.0.9
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/lib/GunnyLog.rb +44 -27
- data/lib/GunnyLog/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 772e6881f38897b22ad442e76899e08311574f7d
|
4
|
+
data.tar.gz: 66316fcbe57363e372430524c3ad8daf3aecddbf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f3838e3812c1acca1a4e50bf68ab67f89685d137202c3f4b17f3c4fcd22b9f06ae5c24d801a4202e30b3af417d54c380b1dd9db5defd30581ecba6aca9dcf538
|
7
|
+
data.tar.gz: fb42181161be2d5f92f2ea139fcb4a94889b4c2669a173ff10ad0fdee518fdeb800675936d3a35431773a32ad5e88a9db261bc4b86f6e05bac789fa53234d6c4
|
data/lib/GunnyLog.rb
CHANGED
@@ -4,12 +4,50 @@ require 'GunnyLog/exceptions'
|
|
4
4
|
require 'singleton'
|
5
5
|
require 'date'
|
6
6
|
|
7
|
-
|
8
|
-
# GunnyLog
|
9
|
-
#
|
10
|
-
# log = GunnyLog.instance
|
7
|
+
# GunnyLog logs messages to stdout, stderr, or a file. It defaults
|
8
|
+
# to stdout. GunnyLog is a singleton and uses the instance method.
|
9
|
+
# For example you can use GunnyLog.instance.msg('Error message')
|
10
|
+
# or you can use log = GunnyLog.instance
|
11
11
|
class GunnyLog
|
12
12
|
|
13
|
+
include Singleton
|
14
|
+
|
15
|
+
# public class attributes
|
16
|
+
|
17
|
+
class << self;
|
18
|
+
# Logging flag on and off (default=on)
|
19
|
+
private
|
20
|
+
attr_accessor :_is_logging_enabled
|
21
|
+
end
|
22
|
+
|
23
|
+
# @return [bool] is logging enabled
|
24
|
+
attr_reader :_is_logging_enabled
|
25
|
+
|
26
|
+
class << self;
|
27
|
+
# The location that the message was from
|
28
|
+
private
|
29
|
+
attr_accessor :message_location
|
30
|
+
end
|
31
|
+
|
32
|
+
# @return [string] message location
|
33
|
+
attr_reader :message_location
|
34
|
+
|
35
|
+
# private class attributes
|
36
|
+
|
37
|
+
class << self;
|
38
|
+
# Is file open flag
|
39
|
+
private
|
40
|
+
attr_accessor :_is_file_open
|
41
|
+
end
|
42
|
+
|
43
|
+
class << self;
|
44
|
+
# File used for the log file
|
45
|
+
private
|
46
|
+
attr_accessor :logging_file
|
47
|
+
end
|
48
|
+
|
49
|
+
# public instance methods
|
50
|
+
|
13
51
|
# Set logging on and off
|
14
52
|
# @param flag [bool] switch for on or off
|
15
53
|
def set_logging_enabled(flag)
|
@@ -63,7 +101,7 @@ class GunnyLog
|
|
63
101
|
end
|
64
102
|
end
|
65
103
|
|
66
|
-
# Open the logfile with path, name, and
|
104
|
+
# Open the logfile with path, name, and extension
|
67
105
|
# @param pathname [string] path of the logfile
|
68
106
|
# @param filename [string] name of the logfile
|
69
107
|
# @param extension [string] extension of the logfile
|
@@ -119,30 +157,9 @@ class GunnyLog
|
|
119
157
|
message(loc, formatted)
|
120
158
|
end
|
121
159
|
|
160
|
+
# private instance methods
|
122
161
|
private
|
123
162
|
|
124
|
-
include Singleton
|
125
|
-
|
126
|
-
class << self;
|
127
|
-
# Logging off and on flag
|
128
|
-
attr_accessor :_is_logging_enabled
|
129
|
-
end
|
130
|
-
|
131
|
-
class << self;
|
132
|
-
# Location message was logged from
|
133
|
-
attr_accessor :message_location
|
134
|
-
end
|
135
|
-
|
136
|
-
class << self;
|
137
|
-
# Is file open flag
|
138
|
-
attr_accessor :_is_file_open
|
139
|
-
end
|
140
|
-
|
141
|
-
class << self;
|
142
|
-
# File used for the log file
|
143
|
-
attr_accessor :logging_file
|
144
|
-
end
|
145
|
-
|
146
163
|
# initailize
|
147
164
|
def initialize
|
148
165
|
@_is_logging_enabled = true
|
data/lib/GunnyLog/version.rb
CHANGED
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.0.
|
4
|
+
version: 1.0.9
|
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-11 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Ruby class for logging to screen or file
|
14
14
|
email: gunnyhwy21@yahoo.com
|
@@ -44,3 +44,4 @@ signing_key:
|
|
44
44
|
specification_version: 4
|
45
45
|
summary: Ruby log file class
|
46
46
|
test_files: []
|
47
|
+
has_rdoc:
|