logutils 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Manifest.txt +10 -11
- data/lib/logutils/db/schema.rb +1 -1
- data/lib/logutils/version.rb +1 -1
- metadata +61 -36
- data/NOTES.md +0 -81
data/Manifest.txt
CHANGED
@@ -1,11 +1,10 @@
|
|
1
|
-
History.md
|
2
|
-
Manifest.txt
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
lib/logutils.rb
|
7
|
-
lib/logutils/db/
|
8
|
-
lib/logutils/db/
|
9
|
-
lib/logutils/
|
10
|
-
lib/logutils/
|
11
|
-
lib/logutils/version.rb
|
1
|
+
History.md
|
2
|
+
Manifest.txt
|
3
|
+
README.md
|
4
|
+
Rakefile
|
5
|
+
lib/logutils.rb
|
6
|
+
lib/logutils/db/deleter.rb
|
7
|
+
lib/logutils/db/models.rb
|
8
|
+
lib/logutils/db/schema.rb
|
9
|
+
lib/logutils/logger.rb
|
10
|
+
lib/logutils/version.rb
|
data/lib/logutils/db/schema.rb
CHANGED
@@ -13,7 +13,7 @@ create_table :logs do |t|
|
|
13
13
|
t.string :app
|
14
14
|
t.string :tag # e.g. class name w/ namespace e.g. SportDB.Reader etc. # NB: change to name?
|
15
15
|
t.integer :pid
|
16
|
-
t.
|
16
|
+
t.integer :tid
|
17
17
|
t.string :ts # timestamp - change to datetime?
|
18
18
|
# add filename, line, method ??
|
19
19
|
t.timestamps
|
data/lib/logutils/version.rb
CHANGED
metadata
CHANGED
@@ -1,48 +1,63 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: logutils
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 23
|
5
5
|
prerelease:
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 2
|
9
|
+
- 0
|
10
|
+
version: 0.2.0
|
6
11
|
platform: ruby
|
7
|
-
authors:
|
12
|
+
authors:
|
8
13
|
- Gerald Bauer
|
9
14
|
autorequire:
|
10
15
|
bindir: bin
|
11
16
|
cert_chain: []
|
12
|
-
|
13
|
-
|
14
|
-
|
17
|
+
|
18
|
+
date: 2013-02-20 00:00:00 Z
|
19
|
+
dependencies:
|
20
|
+
- !ruby/object:Gem::Dependency
|
15
21
|
name: rdoc
|
16
|
-
|
22
|
+
prerelease: false
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
17
24
|
none: false
|
18
|
-
requirements:
|
25
|
+
requirements:
|
19
26
|
- - ~>
|
20
|
-
- !ruby/object:Gem::Version
|
21
|
-
|
27
|
+
- !ruby/object:Gem::Version
|
28
|
+
hash: 19
|
29
|
+
segments:
|
30
|
+
- 3
|
31
|
+
- 10
|
32
|
+
version: "3.10"
|
22
33
|
type: :development
|
23
|
-
|
24
|
-
|
25
|
-
- !ruby/object:Gem::Dependency
|
34
|
+
version_requirements: *id001
|
35
|
+
- !ruby/object:Gem::Dependency
|
26
36
|
name: hoe
|
27
|
-
|
37
|
+
prerelease: false
|
38
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
28
39
|
none: false
|
29
|
-
requirements:
|
40
|
+
requirements:
|
30
41
|
- - ~>
|
31
|
-
- !ruby/object:Gem::Version
|
32
|
-
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
hash: 1
|
44
|
+
segments:
|
45
|
+
- 3
|
46
|
+
- 3
|
47
|
+
version: "3.3"
|
33
48
|
type: :development
|
34
|
-
|
35
|
-
version_requirements: *21072828
|
49
|
+
version_requirements: *id002
|
36
50
|
description: Another Logger
|
37
51
|
email: opensport@googlegroups.com
|
38
52
|
executables: []
|
53
|
+
|
39
54
|
extensions: []
|
40
|
-
|
55
|
+
|
56
|
+
extra_rdoc_files:
|
41
57
|
- Manifest.txt
|
42
|
-
files:
|
58
|
+
files:
|
43
59
|
- History.md
|
44
60
|
- Manifest.txt
|
45
|
-
- NOTES.md
|
46
61
|
- README.md
|
47
62
|
- Rakefile
|
48
63
|
- lib/logutils.rb
|
@@ -52,30 +67,40 @@ files:
|
|
52
67
|
- lib/logutils/logger.rb
|
53
68
|
- lib/logutils/version.rb
|
54
69
|
homepage: https://github.com/geraldb/logutils
|
55
|
-
licenses:
|
70
|
+
licenses:
|
56
71
|
- Public Domain
|
57
72
|
post_install_message:
|
58
|
-
rdoc_options:
|
73
|
+
rdoc_options:
|
59
74
|
- --main
|
60
75
|
- README.md
|
61
|
-
require_paths:
|
76
|
+
require_paths:
|
62
77
|
- lib
|
63
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
78
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
64
79
|
none: false
|
65
|
-
requirements:
|
66
|
-
- -
|
67
|
-
- !ruby/object:Gem::Version
|
80
|
+
requirements:
|
81
|
+
- - ">="
|
82
|
+
- !ruby/object:Gem::Version
|
83
|
+
hash: 55
|
84
|
+
segments:
|
85
|
+
- 1
|
86
|
+
- 9
|
87
|
+
- 2
|
68
88
|
version: 1.9.2
|
69
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
89
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
70
90
|
none: false
|
71
|
-
requirements:
|
72
|
-
- -
|
73
|
-
- !ruby/object:Gem::Version
|
74
|
-
|
91
|
+
requirements:
|
92
|
+
- - ">="
|
93
|
+
- !ruby/object:Gem::Version
|
94
|
+
hash: 3
|
95
|
+
segments:
|
96
|
+
- 0
|
97
|
+
version: "0"
|
75
98
|
requirements: []
|
99
|
+
|
76
100
|
rubyforge_project: logutils
|
77
|
-
rubygems_version: 1.8.
|
101
|
+
rubygems_version: 1.8.24
|
78
102
|
signing_key:
|
79
103
|
specification_version: 3
|
80
104
|
summary: Another Logger
|
81
105
|
test_files: []
|
106
|
+
|
data/NOTES.md
DELETED
@@ -1,81 +0,0 @@
|
|
1
|
-
# Dev Notes
|
2
|
-
|
3
|
-
## todo add name, level
|
4
|
-
|
5
|
-
LogUtils[ name ] or
|
6
|
-
LogUtils.logger( name ) e.g. LogUtils[ self ]
|
7
|
-
|
8
|
-
add logger to logger repo
|
9
|
-
|
10
|
-
## todo support
|
11
|
-
|
12
|
-
logger.debug?
|
13
|
-
logger.warn?
|
14
|
-
etc.
|
15
|
-
|
16
|
-
## todo support blocks for conditional evaluation
|
17
|
-
|
18
|
-
logger.debug { ruby code here }
|
19
|
-
|
20
|
-
|
21
|
-
### How to get process id (pid)?
|
22
|
-
|
23
|
-
* Yell uses Process.pid
|
24
|
-
* Logging ???
|
25
|
-
* Log4r
|
26
|
-
|
27
|
-
### How to get thread id (tid)?
|
28
|
-
|
29
|
-
* Yell uses Thread.current.object_id
|
30
|
-
* Logging ???
|
31
|
-
* Log4r ???
|
32
|
-
|
33
|
-
### How to get timestamp (ts)?
|
34
|
-
|
35
|
-
* Yell uses Time.now
|
36
|
-
|
37
|
-
### How to get filename, line, method?
|
38
|
-
|
39
|
-
use caller ?
|
40
|
-
|
41
|
-
|
42
|
-
### Notes on logging levels/serverity
|
43
|
-
|
44
|
-
todo/check: use int constants or strings?
|
45
|
-
|
46
|
-
There are two things you should know about log levels/severity:
|
47
|
-
- syslog defines levels from 0 (Emergency) to 7 (Debug).
|
48
|
-
0 (Emergency) and 1 (Alert) levels are reserved for OS kernel.
|
49
|
-
- Ruby default Logger defines levels from 0 (DEBUG) to 4 (FATAL) and 5 (UNKNOWN).
|
50
|
-
Note that order is inverted.
|
51
|
-
For compatibility we define our constants as Ruby Logger, and convert values before
|
52
|
-
generating GELF message, using defined mapping.
|
53
|
-
|
54
|
-
module Levels
|
55
|
-
DEBUG = 0
|
56
|
-
INFO = 1
|
57
|
-
WARN = 2
|
58
|
-
ERROR = 3
|
59
|
-
FATAL = 4
|
60
|
-
UNKNOWN = 5
|
61
|
-
end
|
62
|
-
|
63
|
-
include Levels
|
64
|
-
|
65
|
-
Maps Ruby Logger levels to syslog levels as SyslogLogger and syslogger gems. This one is default.
|
66
|
-
LOGGER_MAPPING = {DEBUG => 7, # Debug
|
67
|
-
INFO => 6, # Info
|
68
|
-
WARN => 5, # Notice
|
69
|
-
ERROR => 4, # Warning
|
70
|
-
FATAL => 3, # Error
|
71
|
-
UNKNOWN => 1} # Alert � shouldn't be used
|
72
|
-
|
73
|
-
Maps Ruby Logger levels to syslog levels as is.
|
74
|
-
DIRECT_MAPPING = {DEBUG => 7, # Debug
|
75
|
-
INFO => 6, # Info
|
76
|
-
# skip 5 Notice
|
77
|
-
WARN => 4, # Warning
|
78
|
-
ERROR => 3, # Error
|
79
|
-
FATAL => 2, # Critical
|
80
|
-
UNKNOWN => 1} # Alert � shouldn't be used
|
81
|
-
end
|