mklog 0.2.0 → 0.2.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.
- data/lib/mklog.rb +29 -2
- metadata +2 -2
data/lib/mklog.rb
CHANGED
@@ -5,11 +5,38 @@ require 'mklog/debugtype/object'
|
|
5
5
|
|
6
6
|
module MKLog
|
7
7
|
class Log
|
8
|
-
|
9
|
-
|
8
|
+
|
9
|
+
# Dump object or text message into the log file
|
10
|
+
#
|
11
|
+
# Example (saving plain message):
|
12
|
+
# >> MKLog::Log.save ('message for saving')
|
13
|
+
#
|
14
|
+
# Example (saving object - for example user object):
|
15
|
+
# >> MKLog::Log.save (user, MKLog::DebugType::OBJECT)
|
16
|
+
#
|
17
|
+
# Arguments:
|
18
|
+
# data for save: (String or Other Object)
|
19
|
+
# debug type: (MKLog::DebugType::NORMAL or MKLog::DebugType::OBJECT)
|
20
|
+
# filename: (String)
|
21
|
+
|
22
|
+
def self.save(message, debug_type=MKLog::DebugType::NORMAL, filename='system.log')
|
23
|
+
@dt = MKLog::DebugType::get_class(debug_type)
|
10
24
|
@dt.filename = filename
|
11
25
|
@dt.message = message
|
12
26
|
@dt.save
|
13
27
|
end
|
14
28
|
end
|
15
29
|
end
|
30
|
+
|
31
|
+
|
32
|
+
|
33
|
+
|
34
|
+
|
35
|
+
|
36
|
+
|
37
|
+
|
38
|
+
|
39
|
+
|
40
|
+
|
41
|
+
|
42
|
+
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mklog
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-02-
|
12
|
+
date: 2013-02-10 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: Simple file logging messages and objects
|
15
15
|
email: mrkkrstic@gmail.com
|