logging 0.6.0 → 0.6.1
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +5 -0
- data/Manifest.txt +7 -7
- data/Rakefile +3 -7
- data/lib/logging.rb +9 -3
- data/lib/logging/appender.rb +1 -5
- data/lib/logging/appenders/console.rb +1 -3
- data/lib/logging/appenders/file.rb +1 -3
- data/lib/logging/appenders/growl.rb +1 -3
- data/lib/logging/appenders/io.rb +1 -3
- data/lib/logging/appenders/rolling_file.rb +8 -4
- data/lib/logging/appenders/static_appender.rb +1 -3
- data/lib/logging/appenders/syslog.rb +1 -2
- data/lib/logging/config/yaml_configurator.rb +1 -2
- data/lib/logging/layout.rb +1 -2
- data/lib/logging/layouts/basic.rb +1 -5
- data/lib/logging/layouts/pattern.rb +1 -4
- data/lib/logging/logger.rb +1 -6
- data/lib/logging/repository.rb +1 -3
- data/lib/logging/root_logger.rb +1 -4
- data/tasks/annotations.rake +30 -0
- data/{rakelib → tasks}/doc.rake +7 -1
- data/{rakelib → tasks}/gem.rake +6 -2
- data/{rakelib → tasks}/manifest.rake +6 -4
- data/{rakelib → tasks}/rubyforge.rake +1 -1
- data/{rakelib → tasks}/setup.rb +24 -6
- data/{rakelib → tasks}/test.rake +5 -0
- data/test/setup.rb +2 -10
- metadata +9 -18
- data/rakelib/website.rake +0 -38
data/History.txt
CHANGED
data/Manifest.txt
CHANGED
@@ -22,13 +22,13 @@ lib/logging/logger.rb
|
|
22
22
|
lib/logging/repository.rb
|
23
23
|
lib/logging/root_logger.rb
|
24
24
|
lib/logging/utils.rb
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
25
|
+
tasks/annotations.rake
|
26
|
+
tasks/doc.rake
|
27
|
+
tasks/gem.rake
|
28
|
+
tasks/manifest.rake
|
29
|
+
tasks/rubyforge.rake
|
30
|
+
tasks/setup.rb
|
31
|
+
tasks/test.rake
|
32
32
|
test/appenders/test_console.rb
|
33
33
|
test/appenders/test_email.rb
|
34
34
|
test/appenders/test_file.rb
|
data/Rakefile
CHANGED
@@ -1,8 +1,7 @@
|
|
1
1
|
# $Id$
|
2
2
|
|
3
|
-
load '
|
3
|
+
load 'tasks/setup.rb'
|
4
4
|
ensure_in_path 'lib'
|
5
|
-
|
6
5
|
require 'logging'
|
7
6
|
|
8
7
|
task :default => 'test:run'
|
@@ -20,11 +19,8 @@ PROJ.rdoc_dir = 'doc/rdoc'
|
|
20
19
|
PROJ.rdoc_remote_dir = ''
|
21
20
|
PROJ.version = Logging::VERSION
|
22
21
|
|
23
|
-
PROJ.exclude << '^
|
24
|
-
PROJ.
|
25
|
-
PROJ.exclude << '^(\.\/|\/)?tags$'
|
26
|
-
PROJ.rdoc_exclude << '^(\.\/|\/)?data'
|
27
|
-
PROJ.rdoc_exclude << '^(\.\/|\/)?website'
|
22
|
+
PROJ.exclude << '^tags$' << '^tasks/archive'
|
23
|
+
PROJ.rdoc_exclude << '^data'
|
28
24
|
|
29
25
|
depend_on 'flexmock'
|
30
26
|
depend_on 'lockfile'
|
data/lib/logging.rb
CHANGED
@@ -1,15 +1,21 @@
|
|
1
|
-
# $Id: logging.rb
|
1
|
+
# $Id: logging.rb 80 2008-01-01 22:39:52Z tim_pease $
|
2
2
|
|
3
3
|
require 'logging/utils'
|
4
|
+
require 'logging/log_event'
|
5
|
+
require 'logging/logger'
|
6
|
+
require 'logging/root_logger'
|
4
7
|
require 'logging/repository'
|
8
|
+
require 'logging/appender'
|
9
|
+
require 'logging/layout'
|
5
10
|
|
6
11
|
# require all appenders
|
12
|
+
require 'logging/appenders/static_appender'
|
13
|
+
require 'logging/appenders/io'
|
7
14
|
require 'logging/appenders/console'
|
8
15
|
require 'logging/appenders/email'
|
9
16
|
require 'logging/appenders/file'
|
10
17
|
require 'logging/appenders/growl'
|
11
18
|
require 'logging/appenders/rolling_file'
|
12
|
-
require 'logging/appenders/static_appender'
|
13
19
|
require 'logging/appenders/syslog'
|
14
20
|
|
15
21
|
# require all layouts
|
@@ -24,7 +30,7 @@ require 'logging/config/yaml_configurator'
|
|
24
30
|
#
|
25
31
|
module Logging
|
26
32
|
|
27
|
-
VERSION = '0.6.
|
33
|
+
VERSION = '0.6.1' # :nodoc:
|
28
34
|
|
29
35
|
LEVELS = {} # :nodoc:
|
30
36
|
LNAMES = {} # :nodoc:
|
data/lib/logging/appender.rb
CHANGED
@@ -1,10 +1,6 @@
|
|
1
|
-
# $Id: appender.rb
|
1
|
+
# $Id: appender.rb 77 2007-12-30 02:21:33Z tim_pease $
|
2
2
|
|
3
3
|
require 'thread'
|
4
|
-
require 'logging'
|
5
|
-
require 'logging/logger'
|
6
|
-
require 'logging/layout'
|
7
|
-
require 'logging/layouts/basic'
|
8
4
|
|
9
5
|
module Logging
|
10
6
|
|
data/lib/logging/appenders/io.rb
CHANGED
@@ -1,7 +1,11 @@
|
|
1
|
-
# $Id: rolling_file.rb
|
2
|
-
|
3
|
-
|
4
|
-
require 'lockfile'
|
1
|
+
# $Id: rolling_file.rb 77 2007-12-30 02:21:33Z tim_pease $
|
2
|
+
|
3
|
+
begin
|
4
|
+
require 'lockfile'
|
5
|
+
rescue LoadError
|
6
|
+
require 'rubygems'
|
7
|
+
require 'lockfile'
|
8
|
+
end
|
5
9
|
|
6
10
|
module Logging::Appenders
|
7
11
|
|
data/lib/logging/layout.rb
CHANGED
data/lib/logging/logger.rb
CHANGED
@@ -1,11 +1,6 @@
|
|
1
|
-
# $Id: logger.rb
|
1
|
+
# $Id: logger.rb 77 2007-12-30 02:21:33Z tim_pease $
|
2
2
|
|
3
3
|
require 'thread'
|
4
|
-
require 'logging'
|
5
|
-
require 'logging/appender'
|
6
|
-
require 'logging/log_event'
|
7
|
-
require 'logging/repository'
|
8
|
-
|
9
4
|
|
10
5
|
module Logging
|
11
6
|
|
data/lib/logging/repository.rb
CHANGED
data/lib/logging/root_logger.rb
CHANGED
@@ -0,0 +1,30 @@
|
|
1
|
+
# $Id$
|
2
|
+
|
3
|
+
if HAVE_BONES
|
4
|
+
|
5
|
+
desc "Enumerate all annotations"
|
6
|
+
task :notes do
|
7
|
+
Bones::AnnotationExtractor.enumerate(
|
8
|
+
PROJ, "OPTIMIZE|FIXME|TODO", :tag => true)
|
9
|
+
end
|
10
|
+
|
11
|
+
namespace :notes do
|
12
|
+
desc "Enumerate all OPTIMIZE annotations"
|
13
|
+
task :optimize do
|
14
|
+
Bones::AnnotationExtractor.enumerate(PROJ, "OPTIMIZE")
|
15
|
+
end
|
16
|
+
|
17
|
+
desc "Enumerate all FIXME annotations"
|
18
|
+
task :fixme do
|
19
|
+
Bones::AnnotationExtractor.enumerate(PROJ, "FIXME")
|
20
|
+
end
|
21
|
+
|
22
|
+
desc "Enumerate all TODO annotations"
|
23
|
+
task :todo do
|
24
|
+
Bones::AnnotationExtractor.enumerate(PROJ, "TODO")
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
end # if HAVE_BONES
|
29
|
+
|
30
|
+
# EOF
|
data/{rakelib → tasks}/doc.rake
RENAMED
@@ -1,4 +1,4 @@
|
|
1
|
-
# $Id
|
1
|
+
# $Id$
|
2
2
|
|
3
3
|
require 'rake/rdoctask'
|
4
4
|
|
@@ -38,6 +38,12 @@ namespace :doc do
|
|
38
38
|
|
39
39
|
end # namespace :doc
|
40
40
|
|
41
|
+
desc 'Alias to doc:rdoc'
|
42
|
+
task :doc => 'doc:rdoc'
|
43
|
+
|
44
|
+
desc 'Remove all build products'
|
41
45
|
task :clobber => %w(doc:clobber_rdoc doc:clobber_ri)
|
42
46
|
|
47
|
+
remove_desc_for_task %w(doc:clobber_rdoc doc:clobber_ri)
|
48
|
+
|
43
49
|
# EOF
|
data/{rakelib → tasks}/gem.rake
RENAMED
@@ -1,4 +1,4 @@
|
|
1
|
-
# $Id
|
1
|
+
# $Id$
|
2
2
|
|
3
3
|
require 'rake/gempackagetask'
|
4
4
|
|
@@ -18,7 +18,6 @@ namespace :gem do
|
|
18
18
|
PROJ.dependencies.each do |dep|
|
19
19
|
s.add_dependency(*dep)
|
20
20
|
end
|
21
|
-
s.add_dependency('rake', ">= #{RAKEVERSION}")
|
22
21
|
|
23
22
|
s.files = PROJ.files
|
24
23
|
s.executables = PROJ.executables.map {|fn| File.basename(fn)}
|
@@ -80,6 +79,11 @@ namespace :gem do
|
|
80
79
|
|
81
80
|
end # namespace :gem
|
82
81
|
|
82
|
+
desc 'Alias to gem:package'
|
83
|
+
task :gem => 'gem:package'
|
84
|
+
|
83
85
|
task :clobber => 'gem:clobber_package'
|
84
86
|
|
87
|
+
remove_desc_for_task %w(gem:clobber_package)
|
88
|
+
|
85
89
|
# EOF
|
@@ -1,18 +1,19 @@
|
|
1
|
-
# $Id
|
1
|
+
# $Id$
|
2
2
|
|
3
3
|
require 'find'
|
4
4
|
|
5
5
|
namespace :manifest do
|
6
6
|
|
7
|
-
desc 'Verify the
|
7
|
+
desc 'Verify the manifest'
|
8
8
|
task :check do
|
9
9
|
fn = 'Manifest.tmp'
|
10
10
|
files = []
|
11
11
|
exclude = Regexp.new(PROJ.exclude.join('|'))
|
12
12
|
Find.find '.' do |path|
|
13
|
+
path.sub! %r/^(\.\/|\/)/o, ''
|
13
14
|
next unless test ?f, path
|
14
15
|
next if path =~ exclude
|
15
|
-
files << path
|
16
|
+
files << path
|
16
17
|
end
|
17
18
|
|
18
19
|
File.open(fn, 'w') {|fp| fp.puts files.sort}
|
@@ -26,9 +27,10 @@ namespace :manifest do
|
|
26
27
|
files = []
|
27
28
|
exclude = Regexp.new(PROJ.exclude.join('|'))
|
28
29
|
Find.find '.' do |path|
|
30
|
+
path.sub! %r/^(\.\/|\/)/o, ''
|
29
31
|
next unless test ?f, path
|
30
32
|
next if path =~ exclude
|
31
|
-
files << path
|
33
|
+
files << path
|
32
34
|
end
|
33
35
|
|
34
36
|
files << fn unless test ?f, fn
|
data/{rakelib → tasks}/setup.rb
RENAMED
@@ -1,4 +1,4 @@
|
|
1
|
-
# $Id: setup.rb
|
1
|
+
# $Id: setup.rb 79 2008-01-01 20:29:30Z tim_pease $
|
2
2
|
|
3
3
|
require 'rubygems'
|
4
4
|
require 'rake'
|
@@ -16,7 +16,7 @@ PROJ.email = nil
|
|
16
16
|
PROJ.url = nil
|
17
17
|
PROJ.version = ENV['VERSION'] || '0.0.0'
|
18
18
|
PROJ.rubyforge_name = nil
|
19
|
-
PROJ.exclude = %w(tmp$ bak$ ~$ CVS \.svn)
|
19
|
+
PROJ.exclude = %w(tmp$ bak$ ~$ CVS \.svn ^pkg ^doc)
|
20
20
|
|
21
21
|
# Rspec
|
22
22
|
PROJ.specs = FileList['spec/**/*_spec.rb']
|
@@ -56,6 +56,13 @@ PROJ.dependencies = []
|
|
56
56
|
PROJ.need_tar = true
|
57
57
|
PROJ.need_zip = false
|
58
58
|
|
59
|
+
# File Annotations
|
60
|
+
PROJ.annotation_exclude = []
|
61
|
+
PROJ.annotation_extensions = %w(.txt .rb .erb) << ''
|
62
|
+
|
63
|
+
# Load the other rake files in the tasks folder
|
64
|
+
Dir.glob('tasks/*.rake').sort.each {|fn| import fn}
|
65
|
+
|
59
66
|
# Setup some constants
|
60
67
|
WIN32 = %r/win32/ =~ RUBY_PLATFORM unless defined? WIN32
|
61
68
|
|
@@ -86,12 +93,12 @@ SUDO = if WIN32 then ''
|
|
86
93
|
RCOV = WIN32 ? 'rcov.cmd' : 'rcov'
|
87
94
|
GEM = WIN32 ? 'gem.cmd' : 'gem'
|
88
95
|
|
89
|
-
%w(rcov spec rubyforge).each do |lib|
|
96
|
+
%w(rcov spec/rake/spectask rubyforge bones).each do |lib|
|
90
97
|
begin
|
91
98
|
require lib
|
92
|
-
Object.instance_eval {const_set "HAVE_#{lib.upcase}", true}
|
99
|
+
Object.instance_eval {const_set "HAVE_#{lib.tr('/','_').upcase}", true}
|
93
100
|
rescue LoadError
|
94
|
-
Object.instance_eval {const_set "HAVE_#{lib.upcase}", false}
|
101
|
+
Object.instance_eval {const_set "HAVE_#{lib.tr('/','_').upcase}", false}
|
95
102
|
end
|
96
103
|
end
|
97
104
|
|
@@ -120,7 +127,18 @@ end
|
|
120
127
|
#
|
121
128
|
def ensure_in_path( path )
|
122
129
|
path = File.expand_path(path)
|
123
|
-
|
130
|
+
$:.unshift(path) if test(?d, path) and not $:.include?(path)
|
131
|
+
end
|
132
|
+
|
133
|
+
# Find a rake task using the task name and remove any description text. This
|
134
|
+
# will prevent the task from being displayed in the list of available tasks.
|
135
|
+
#
|
136
|
+
def remove_desc_for_task( names )
|
137
|
+
Array(names).each do |task_name|
|
138
|
+
task = Rake.application.tasks.find {|t| t.name == task_name}
|
139
|
+
next if task.nil?
|
140
|
+
task.instance_variable_set :@comment, nil
|
141
|
+
end
|
124
142
|
end
|
125
143
|
|
126
144
|
# EOF
|
data/{rakelib → tasks}/test.rake
RENAMED
data/test/setup.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# $Id: setup.rb
|
1
|
+
# $Id: setup.rb 77 2007-12-30 02:21:33Z tim_pease $
|
2
2
|
|
3
3
|
require 'test/unit'
|
4
4
|
|
@@ -7,15 +7,7 @@ require 'test/unit'
|
|
7
7
|
#
|
8
8
|
KeyError = IndexError if not defined? KeyError
|
9
9
|
|
10
|
-
|
11
|
-
require 'rubygems'
|
12
|
-
require 'logging'
|
13
|
-
rescue LoadError
|
14
|
-
path = File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib'))
|
15
|
-
raise if $:.include? path
|
16
|
-
$: << path
|
17
|
-
retry
|
18
|
-
end
|
10
|
+
require File.join(File.dirname(__FILE__), '..', 'lib', 'logging')
|
19
11
|
|
20
12
|
begin
|
21
13
|
require 'turn'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logging
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tim Pease
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date:
|
12
|
+
date: 2008-01-01 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -30,15 +30,6 @@ dependencies:
|
|
30
30
|
- !ruby/object:Gem::Version
|
31
31
|
version: 1.4.3
|
32
32
|
version:
|
33
|
-
- !ruby/object:Gem::Dependency
|
34
|
-
name: rake
|
35
|
-
version_requirement:
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - ">="
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: 0.8.1
|
41
|
-
version:
|
42
33
|
description: Logging is a flexible logging library for use in Ruby programs based on the design of Java's log4j library. It features a hierarchical logging system, custom level names, multiple output destinations per log event, custom formatting, and more.
|
43
34
|
email: tim.pease@gmail.com
|
44
35
|
executables: []
|
@@ -73,13 +64,13 @@ files:
|
|
73
64
|
- lib/logging/repository.rb
|
74
65
|
- lib/logging/root_logger.rb
|
75
66
|
- lib/logging/utils.rb
|
76
|
-
-
|
77
|
-
-
|
78
|
-
-
|
79
|
-
-
|
80
|
-
-
|
81
|
-
-
|
82
|
-
-
|
67
|
+
- tasks/annotations.rake
|
68
|
+
- tasks/doc.rake
|
69
|
+
- tasks/gem.rake
|
70
|
+
- tasks/manifest.rake
|
71
|
+
- tasks/rubyforge.rake
|
72
|
+
- tasks/setup.rb
|
73
|
+
- tasks/test.rake
|
83
74
|
- test/appenders/test_console.rb
|
84
75
|
- test/appenders/test_email.rb
|
85
76
|
- test/appenders/test_file.rb
|
data/rakelib/website.rake
DELETED
@@ -1,38 +0,0 @@
|
|
1
|
-
# $Id: website.rake 12 2007-08-23 16:43:11Z tim_pease $
|
2
|
-
|
3
|
-
namespace :website do
|
4
|
-
|
5
|
-
desc 'Build the Logging website'
|
6
|
-
task :build do
|
7
|
-
begin
|
8
|
-
olddir = pwd
|
9
|
-
chdir 'website'
|
10
|
-
sh 'rake build'
|
11
|
-
cp_r 'output/.', olddir + '/doc'
|
12
|
-
ensure
|
13
|
-
chdir olddir
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|
17
|
-
desc 'Remove the Logging website'
|
18
|
-
task :clobber do
|
19
|
-
rm_r 'doc' rescue nil
|
20
|
-
end
|
21
|
-
|
22
|
-
desc 'Publish the website to RubyForge'
|
23
|
-
task :release => %w(website:clobber doc:rdoc website:build) do
|
24
|
-
config = YAML.load(
|
25
|
-
File.read(File.expand_path('~/.rubyforge/user-config.yml'))
|
26
|
-
)
|
27
|
-
|
28
|
-
host = "#{config['username']}@rubyforge.org"
|
29
|
-
remote_dir = "/var/www/gforge-projects/#{PROJ.rubyforge_name}/"
|
30
|
-
|
31
|
-
sh "rsync --delete -rulptzCF doc/ #{host}:#{remote_dir}"
|
32
|
-
end
|
33
|
-
|
34
|
-
end # namespace :website
|
35
|
-
|
36
|
-
task :clobber => 'website:clobber'
|
37
|
-
|
38
|
-
# EOF
|