webget_ruby_vital 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/webget_ruby_vital.rb +69 -0
- data/test/webget_ruby_vital_test.rb +14 -0
- data.tar.gz.sig +2 -0
- metadata +87 -0
- metadata.gz.sig +0 -0
@@ -0,0 +1,69 @@
|
|
1
|
+
=begin rdoc
|
2
|
+
|
3
|
+
= WebGet Ruby Gem: Vital
|
4
|
+
|
5
|
+
Author:: Joel Parker Henderson, joelparkerhenderson@gmail.com
|
6
|
+
Copyright:: Copyright (c) 2006-2010 Joel Parker Henderson
|
7
|
+
License:: CreativeCommons License, Non-commercial Share Alike
|
8
|
+
License:: LGPL, GNU Lesser General Public License
|
9
|
+
|
10
|
+
Vital has several methods to help with Ruby's typical logger.
|
11
|
+
|
12
|
+
The methods automatically prepend helpful debugging information
|
13
|
+
to each log message:
|
14
|
+
|
15
|
+
- timestamp
|
16
|
+
- class name
|
17
|
+
- method name
|
18
|
+
- process information
|
19
|
+
- the original message
|
20
|
+
|
21
|
+
The methods log using tab separated values, which make the
|
22
|
+
log files easier to parse in our other tools (i.e. awk).
|
23
|
+
|
24
|
+
=end
|
25
|
+
|
26
|
+
require 'webget_ruby_ramp'
|
27
|
+
|
28
|
+
module Vital
|
29
|
+
|
30
|
+
|
31
|
+
# Log a message with timestamp, calling class, method name, process info, etc.
|
32
|
+
#
|
33
|
+
# ==Example
|
34
|
+
# vital("hello")
|
35
|
+
# => logger.info 2010-12-31 class_name method_name process_info ... hello
|
36
|
+
def vital(msg='',ops={})
|
37
|
+
method_name = ops[:method_name]||method_name_of_caller
|
38
|
+
logger.info [Time.stamp,self.class.name,method_name,Process.ps_tdf].join("\t")+"\t"+msg
|
39
|
+
end
|
40
|
+
|
41
|
+
|
42
|
+
# Log a message that is intended to open (i.e. begin) a topic.
|
43
|
+
#
|
44
|
+
# This simply calls _vital_ with "+" prepended to
|
45
|
+
# the message, which is our indicator of a new topic.
|
46
|
+
#
|
47
|
+
# Example:
|
48
|
+
# vital_open("hello")
|
49
|
+
# => logger.info 2010-12-31 class_name method_name process_info ... +hello
|
50
|
+
|
51
|
+
def vital_open(msg='',ops={})
|
52
|
+
vital('+'+msg,ops.merge({:method_name=>method_name_of_caller}))
|
53
|
+
end
|
54
|
+
|
55
|
+
|
56
|
+
# Log a message that is intended to shut (i.e. end) a topic.
|
57
|
+
#
|
58
|
+
# This simply calls _vital_ with "+" prepended to
|
59
|
+
# the message, which is our indicator of a new topic.
|
60
|
+
#
|
61
|
+
# Example:
|
62
|
+
# vital_open("hello")
|
63
|
+
# => logger.info 2010-12-31 class_name method_name process_info ... -hello
|
64
|
+
|
65
|
+
def vital_shut(msg='',ops={})
|
66
|
+
vital('-'+msg,ops.merge({:method_name=>method_name_of_caller}))
|
67
|
+
end
|
68
|
+
|
69
|
+
end
|
data.tar.gz.sig
ADDED
metadata
ADDED
@@ -0,0 +1,87 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: webget_ruby_vital
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.2
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- WebGet
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain:
|
11
|
+
- |
|
12
|
+
-----BEGIN CERTIFICATE-----
|
13
|
+
MIIDvDCCAyWgAwIBAgIJAIlSqEkDQaZIMA0GCSqGSIb3DQEBBQUAMIGbMQswCQYD
|
14
|
+
VQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNU2FuIEZyYW5j
|
15
|
+
aXNjbzETMBEGA1UEChMKV2ViR2V0LmNvbTETMBEGA1UECxMKV2ViR2V0LmNvbTET
|
16
|
+
MBEGA1UEAxMKV2ViR2V0LmNvbTEgMB4GCSqGSIb3DQEJARYRd2ViZ2V0QHdlYmdl
|
17
|
+
dC5jb20wHhcNMDkwMjI2MTk0NDU4WhcNMTExMTIzMTk0NDU4WjCBmzELMAkGA1UE
|
18
|
+
BhM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cixpG6Uk5qmUsKHRLQf4oQJx7TfLK
|
33
|
+
-----END CERTIFICATE-----
|
34
|
+
|
35
|
+
date: 2010-02-17 00:00:00 -08:00
|
36
|
+
default_executable:
|
37
|
+
dependencies:
|
38
|
+
- !ruby/object:Gem::Dependency
|
39
|
+
name: webget_ruby_ramp
|
40
|
+
type: :runtime
|
41
|
+
version_requirement:
|
42
|
+
version_requirements: !ruby/object:Gem::Requirement
|
43
|
+
requirements:
|
44
|
+
- - ">="
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: 1.7.2
|
47
|
+
version:
|
48
|
+
description:
|
49
|
+
email: webget@webget.com
|
50
|
+
executables: []
|
51
|
+
|
52
|
+
extensions: []
|
53
|
+
|
54
|
+
extra_rdoc_files: []
|
55
|
+
|
56
|
+
files:
|
57
|
+
- lib/webget_ruby_vital.rb
|
58
|
+
has_rdoc: true
|
59
|
+
homepage: http://webget.com/
|
60
|
+
licenses: []
|
61
|
+
|
62
|
+
post_install_message:
|
63
|
+
rdoc_options: []
|
64
|
+
|
65
|
+
require_paths:
|
66
|
+
- lib
|
67
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
68
|
+
requirements:
|
69
|
+
- - ">="
|
70
|
+
- !ruby/object:Gem::Version
|
71
|
+
version: "0"
|
72
|
+
version:
|
73
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
74
|
+
requirements:
|
75
|
+
- - ">="
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: "0"
|
78
|
+
version:
|
79
|
+
requirements: []
|
80
|
+
|
81
|
+
rubyforge_project:
|
82
|
+
rubygems_version: 1.3.5
|
83
|
+
signing_key:
|
84
|
+
specification_version: 3
|
85
|
+
summary: "WebGet Ruby Gem: Vital class for debugging, logging, profiling, etc."
|
86
|
+
test_files:
|
87
|
+
- test/webget_ruby_vital_test.rb
|
metadata.gz.sig
ADDED
Binary file
|