simple-logger 0.0.2 → 0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -0
- data/LICENSE +1 -1
- data/README.textile +7 -0
- data/lib/simple-logger/logger.rb +11 -9
- data/simple-logger.gemspec +9 -5
- metadata +30 -18
- data/Rakefile +0 -0
data/.gitignore
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
/*.gem
|
data/LICENSE
CHANGED
data/README.textile
CHANGED
data/lib/simple-logger/logger.rb
CHANGED
@@ -10,18 +10,20 @@ require_relative "plain"
|
|
10
10
|
|
11
11
|
module SimpleLogger
|
12
12
|
class Logger < Plain
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
13
|
+
def self.colors
|
14
|
+
@@colors ||= {
|
15
|
+
fatal: "red.bold",
|
16
|
+
error: "red",
|
17
|
+
warn: "yellow",
|
18
|
+
info: "green",
|
19
|
+
debug: "cyan",
|
20
|
+
custom: "magenta"
|
21
|
+
}
|
22
|
+
end
|
21
23
|
|
22
24
|
# Generate the logging methods for SimpleLogger.logger for each log level.
|
23
25
|
self::Levels.each_pair do |name, number|
|
24
|
-
color =
|
26
|
+
color = self.colors[name]
|
25
27
|
class_eval <<-RUBY, __FILE__, __LINE__
|
26
28
|
|
27
29
|
# Appends a message to the log if the log level is at least as high as
|
data/simple-logger.gemspec
CHANGED
@@ -1,20 +1,24 @@
|
|
1
1
|
#!/usr/bin/env gem build
|
2
2
|
# encoding: utf-8
|
3
3
|
|
4
|
+
require "base64"
|
5
|
+
|
4
6
|
# NOTE: we can't use require_relative because when we run gem build, it use eval for executing this file
|
5
7
|
Gem::Specification.new do |s|
|
6
8
|
s.name = "simple-logger"
|
7
|
-
s.version = "0.
|
9
|
+
s.version = "0.1"
|
8
10
|
s.authors = ["Jakub Šťastný aka Botanicus"]
|
9
11
|
s.homepage = "http://github.com/botanicus/simple-logger"
|
10
|
-
s.summary = "
|
11
|
-
s.description = "
|
12
|
+
s.summary = "Logger with colours support."
|
13
|
+
s.description = "Smarter clone of Extlib logger with colours support."
|
12
14
|
s.cert_chain = nil
|
13
|
-
s.email =
|
15
|
+
s.email = Base64.decode64("c3Rhc3RueUAxMDFpZGVhcy5jeg==\n")
|
14
16
|
s.has_rdoc = true
|
17
|
+
s.rubyforge_project = "simple-logger"
|
15
18
|
|
16
19
|
# files
|
17
|
-
s.files =
|
20
|
+
s.files = `git ls-files`.split("\n")
|
21
|
+
|
18
22
|
s.require_paths = ["lib"]
|
19
23
|
|
20
24
|
# Ruby version
|
metadata
CHANGED
@@ -1,28 +1,35 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simple-logger
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 0
|
7
|
+
- 1
|
8
|
+
version: "0.1"
|
5
9
|
platform: ruby
|
6
10
|
authors:
|
7
11
|
- "Jakub \xC5\xA0\xC5\xA5astn\xC3\xBD aka Botanicus"
|
8
12
|
autorequire:
|
9
13
|
bindir: bin
|
10
14
|
cert_chain:
|
11
|
-
date:
|
15
|
+
date: 2011-02-25 00:00:00 +00:00
|
12
16
|
default_executable:
|
13
17
|
dependencies:
|
14
18
|
- !ruby/object:Gem::Dependency
|
15
19
|
name: term-ansicolor
|
16
|
-
|
17
|
-
|
18
|
-
|
20
|
+
prerelease: false
|
21
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
22
|
+
none: false
|
19
23
|
requirements:
|
20
24
|
- - ">="
|
21
25
|
- !ruby/object:Gem::Version
|
26
|
+
segments:
|
27
|
+
- 0
|
22
28
|
version: "0"
|
23
|
-
|
24
|
-
|
25
|
-
|
29
|
+
type: :runtime
|
30
|
+
version_requirements: *id001
|
31
|
+
description: Smarter clone of Extlib logger with colours support.
|
32
|
+
email: stastny@101ideas.cz
|
26
33
|
executables: []
|
27
34
|
|
28
35
|
extensions: []
|
@@ -30,15 +37,15 @@ extensions: []
|
|
30
37
|
extra_rdoc_files: []
|
31
38
|
|
32
39
|
files:
|
40
|
+
- .gitignore
|
41
|
+
- LICENSE
|
42
|
+
- README.textile
|
43
|
+
- lib/simple-logger.rb
|
33
44
|
- lib/simple-logger/logger.rb
|
34
45
|
- lib/simple-logger/plain.rb
|
35
|
-
-
|
46
|
+
- simple-logger.gemspec
|
36
47
|
- spec/simple-logger/logger_spec.rb
|
37
48
|
- spec/simple-logger/plain_spec.rb
|
38
|
-
- LICENSE
|
39
|
-
- Rakefile
|
40
|
-
- README.textile
|
41
|
-
- simple-logger.gemspec
|
42
49
|
has_rdoc: true
|
43
50
|
homepage: http://github.com/botanicus/simple-logger
|
44
51
|
licenses: []
|
@@ -49,23 +56,28 @@ rdoc_options: []
|
|
49
56
|
require_paths:
|
50
57
|
- lib
|
51
58
|
required_ruby_version: !ruby/object:Gem::Requirement
|
59
|
+
none: false
|
52
60
|
requirements:
|
53
61
|
- - ~>
|
54
62
|
- !ruby/object:Gem::Version
|
63
|
+
segments:
|
64
|
+
- 1
|
65
|
+
- 9
|
55
66
|
version: "1.9"
|
56
|
-
version:
|
57
67
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
68
|
+
none: false
|
58
69
|
requirements:
|
59
70
|
- - ">="
|
60
71
|
- !ruby/object:Gem::Version
|
72
|
+
segments:
|
73
|
+
- 0
|
61
74
|
version: "0"
|
62
|
-
version:
|
63
75
|
requirements: []
|
64
76
|
|
65
|
-
rubyforge_project:
|
66
|
-
rubygems_version: 1.3.
|
77
|
+
rubyforge_project: simple-logger
|
78
|
+
rubygems_version: 1.3.7
|
67
79
|
signing_key:
|
68
80
|
specification_version: 3
|
69
|
-
summary:
|
81
|
+
summary: Logger with colours support.
|
70
82
|
test_files: []
|
71
83
|
|
data/Rakefile
DELETED
File without changes
|