Skip to content

Commit d0836bb

Browse files
committed
move to logutils/logutils
1 parent 325aaf4 commit d0836bb

File tree

15 files changed

+129
-108
lines changed

15 files changed

+129
-108
lines changed

.gitignore

+7
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,10 @@ tmp
1717
_yardoc
1818
doc/
1919

20+
21+
### add multi-gems
22+
/pkg/
23+
/logutils/pkg/
24+
/logutils-activerecord/pkg/
25+
/logutils-admin/pkg/
26+

README.md

+14-108
Original file line numberDiff line numberDiff line change
@@ -1,108 +1,14 @@
1-
# logutils - Another Logger in Ruby
2-
3-
4-
* home :: [github.com/rubylibs/logutils](https://github.com/rubylibs/logutils)
5-
* bugs :: [github.com/rubylibs/logutils/issues](https://github.com/rubylibs/logutils)
6-
* gem :: [rubygems.org/gems/logutils](https://rubygems.org/gems/logutils)
7-
* rdoc :: [rubydoc.info/gems/logutils](http://rubydoc.info/gems/logutils)
8-
9-
10-
## Usage
11-
12-
Logging levels:
13-
14-
[ALL] < DEBUG < INFO < WARN < ERROR < FATAL < [OFF]
15-
16-
17-
Start by getting a logger e.g.:
18-
19-
logger = LogUtils::Logger.new
20-
21-
or
22-
23-
include LogUtils
24-
25-
logger = Logger.new
26-
27-
now you're ready to log using the methods `#debug`, `#info`, `#warn`, etc.
28-
29-
logger.debug "msg"
30-
logger.info "another msg"
31-
logger.warn "another msg"
32-
logger.error "another msg"
33-
logger.fatal "another msg"
34-
35-
36-
To get a Logger use
37-
38-
logger = Logger[ self ] # pass in object reference
39-
40-
or
41-
42-
logger = Logger[ SportDb::Reader ] # pass in class reference
43-
44-
or
45-
46-
logger = Logger[ 'SportDb::Reader' ] # pass in class name (as string)
47-
48-
49-
### `Logging` Mixin
50-
51-
Note: In a class for convenience you can include the logging machinery
52-
with a single line using the Logging mixin e.g.
53-
54-
include LogUtils::Logging
55-
56-
This will add/mixin the logger attribute reader e.g.
57-
58-
def logger
59-
@logger ||= Logger[ self ]
60-
end
61-
62-
plus the constants for all logging levels, that is, FATAL, ERROR, WARN, etc.
63-
64-
Example:
65-
66-
class SampleClass
67-
include Logging
68-
69-
def initialize
70-
logger.info 'hello SampleClass'
71-
end
72-
end
73-
74-
75-
### Addons / Plugins / Extensions
76-
77-
[logutils-activerecord](https://github.com/rubylibs/logutils-activerecord) - add LogDb, Log Models, etc.
78-
79-
80-
81-
## Real World Usage
82-
83-
[world.db.ruby](https://github.com/worlddb/world.db.ruby) - `world.db` Command Line Tool
84-
85-
[sport.db.ruby](https://github.com/sportdb/sport.db.ruby) - `sport.db` Command Line Tool
86-
87-
[Sportbook](https://github.com/openbookie) - A free, open source sports betting pool
88-
in Ruby on Rails (version 3.2 and up).
89-
90-
91-
## Todos
92-
93-
- [ ] Add TRACE level - why? why not? check std logger
94-
95-
96-
## Alternatives
97-
98-
* [log4r](https://github.com/colbygk/log4r) - Logging Library modeled after log4j in the Java world
99-
* [slf4r](https://github.com/mkristian/slf4r) - Logging Library modeled after slf4j in the Java world
100-
* [yell](https://github.com/rudionrails/yell)
101-
* [logging](https://github.com/TwP/logging)
102-
* [Ruby Toolbox Logging Category](https://www.ruby-toolbox.com/categories/Logging)
103-
104-
105-
## License
106-
107-
The `logutils` scripts are dedicated to the public domain.
108-
Use it as you please with no restrictions whatsoever.
1+
# logutils - another logger in ruby
2+
3+
Gem Family:
4+
5+
- [**logutils**](logutils) - (lite) logger library
6+
- [logutils-activerecord](logutils-activerecord) - ???
7+
8+
9+
## License
10+
11+
The `logutils` scripts are dedicated to the public domain.
12+
Use it as you please with no restrictions whatsoever.
13+
14+
File renamed without changes.
File renamed without changes.
File renamed without changes.

logutils/README.md

+108
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
# logutils - Another Logger in Ruby
2+
3+
4+
* home :: [github.com/rubylibs/logutils](https://github.com/rubylibs/logutils)
5+
* bugs :: [github.com/rubylibs/logutils/issues](https://github.com/rubylibs/logutils)
6+
* gem :: [rubygems.org/gems/logutils](https://rubygems.org/gems/logutils)
7+
* rdoc :: [rubydoc.info/gems/logutils](http://rubydoc.info/gems/logutils)
8+
9+
10+
## Usage
11+
12+
Logging levels:
13+
14+
[ALL] < DEBUG < INFO < WARN < ERROR < FATAL < [OFF]
15+
16+
17+
Start by getting a logger e.g.:
18+
19+
logger = LogUtils::Logger.new
20+
21+
or
22+
23+
include LogUtils
24+
25+
logger = Logger.new
26+
27+
now you're ready to log using the methods `#debug`, `#info`, `#warn`, etc.
28+
29+
logger.debug "msg"
30+
logger.info "another msg"
31+
logger.warn "another msg"
32+
logger.error "another msg"
33+
logger.fatal "another msg"
34+
35+
36+
To get a Logger use
37+
38+
logger = Logger[ self ] # pass in object reference
39+
40+
or
41+
42+
logger = Logger[ SportDb::Reader ] # pass in class reference
43+
44+
or
45+
46+
logger = Logger[ 'SportDb::Reader' ] # pass in class name (as string)
47+
48+
49+
### `Logging` Mixin
50+
51+
Note: In a class for convenience you can include the logging machinery
52+
with a single line using the Logging mixin e.g.
53+
54+
include LogUtils::Logging
55+
56+
This will add/mixin the logger attribute reader e.g.
57+
58+
def logger
59+
@logger ||= Logger[ self ]
60+
end
61+
62+
plus the constants for all logging levels, that is, FATAL, ERROR, WARN, etc.
63+
64+
Example:
65+
66+
class SampleClass
67+
include Logging
68+
69+
def initialize
70+
logger.info 'hello SampleClass'
71+
end
72+
end
73+
74+
75+
### Addons / Plugins / Extensions
76+
77+
[logutils-activerecord](https://github.com/rubylibs/logutils-activerecord) - add LogDb, Log Models, etc.
78+
79+
80+
81+
## Real World Usage
82+
83+
[world.db.ruby](https://github.com/worlddb/world.db.ruby) - `world.db` Command Line Tool
84+
85+
[sport.db.ruby](https://github.com/sportdb/sport.db.ruby) - `sport.db` Command Line Tool
86+
87+
[Sportbook](https://github.com/openbookie) - A free, open source sports betting pool
88+
in Ruby on Rails (version 3.2 and up).
89+
90+
91+
## Todos
92+
93+
- [ ] Add TRACE level - why? why not? check std logger
94+
95+
96+
## Alternatives
97+
98+
* [log4r](https://github.com/colbygk/log4r) - Logging Library modeled after log4j in the Java world
99+
* [slf4r](https://github.com/mkristian/slf4r) - Logging Library modeled after slf4j in the Java world
100+
* [yell](https://github.com/rudionrails/yell)
101+
* [logging](https://github.com/TwP/logging)
102+
* [Ruby Toolbox Logging Category](https://www.ruby-toolbox.com/categories/Logging)
103+
104+
105+
## License
106+
107+
The `logutils` scripts are dedicated to the public domain.
108+
Use it as you please with no restrictions whatsoever.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)