lumberjack 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (60) hide show
  1. data/MIT_LICENSE +20 -0
  2. data/README.rdoc +86 -0
  3. data/Rakefile +56 -0
  4. data/VERSION +1 -0
  5. data/lib/lumberjack.rb +39 -0
  6. data/lib/lumberjack/device.rb +26 -0
  7. data/lib/lumberjack/device/date_rolling_log_file.rb +58 -0
  8. data/lib/lumberjack/device/log_file.rb +18 -0
  9. data/lib/lumberjack/device/null.rb +15 -0
  10. data/lib/lumberjack/device/rolling_log_file.rb +109 -0
  11. data/lib/lumberjack/device/size_rolling_log_file.rb +58 -0
  12. data/lib/lumberjack/device/writer.rb +119 -0
  13. data/lib/lumberjack/formatter.rb +76 -0
  14. data/lib/lumberjack/formatter/exception_formatter.rb +12 -0
  15. data/lib/lumberjack/formatter/inspect_formatter.rb +10 -0
  16. data/lib/lumberjack/formatter/pretty_print_formatter.rb +23 -0
  17. data/lib/lumberjack/formatter/string_formatter.rb +10 -0
  18. data/lib/lumberjack/log_entry.rb +36 -0
  19. data/lib/lumberjack/logger.rb +302 -0
  20. data/lib/lumberjack/rack.rb +5 -0
  21. data/lib/lumberjack/rack/unit_of_work.rb +15 -0
  22. data/lib/lumberjack/severity.rb +23 -0
  23. data/lib/lumberjack/template.rb +71 -0
  24. data/spec/device/date_rolling_log_file_spec.rb +66 -0
  25. data/spec/device/date_rolling_log_file_spec.rbc +2118 -0
  26. data/spec/device/log_file_spec.rb +26 -0
  27. data/spec/device/log_file_spec.rbc +727 -0
  28. data/spec/device/null_spec.rb +12 -0
  29. data/spec/device/null_spec.rbc +362 -0
  30. data/spec/device/rolling_log_file_spec.rb +117 -0
  31. data/spec/device/rolling_log_file_spec.rbc +2894 -0
  32. data/spec/device/size_rolling_log_file_spec.rb +54 -0
  33. data/spec/device/size_rolling_log_file_spec.rbc +1961 -0
  34. data/spec/device/stream_spec.rbc +3310 -0
  35. data/spec/device/writer_spec.rb +118 -0
  36. data/spec/entry_spec.rbc +2333 -0
  37. data/spec/formatter/exception_formatter_spec.rb +20 -0
  38. data/spec/formatter/exception_formatter_spec.rbc +620 -0
  39. data/spec/formatter/inspect_formatter_spec.rb +13 -0
  40. data/spec/formatter/inspect_formatter_spec.rbc +360 -0
  41. data/spec/formatter/pretty_print_formatter_spec.rb +14 -0
  42. data/spec/formatter/pretty_print_formatter_spec.rbc +380 -0
  43. data/spec/formatter/string_formatter_spec.rb +12 -0
  44. data/spec/formatter/string_formatter_spec.rbc +314 -0
  45. data/spec/formatter_spec.rb +45 -0
  46. data/spec/formatter_spec.rbc +1431 -0
  47. data/spec/log_entry_spec.rb +69 -0
  48. data/spec/logger_spec.rb +390 -0
  49. data/spec/logger_spec.rbc +10043 -0
  50. data/spec/lumberjack_spec.rb +22 -0
  51. data/spec/lumberjack_spec.rbc +523 -0
  52. data/spec/rack/unit_of_work_spec.rb +26 -0
  53. data/spec/rack/unit_of_work_spec.rbc +697 -0
  54. data/spec/severity_spec.rb +23 -0
  55. data/spec/spec_helper.rb +16 -0
  56. data/spec/spec_helper.rbc +391 -0
  57. data/spec/template_spec.rb +34 -0
  58. data/spec/template_spec.rbc +1563 -0
  59. data/spec/unique_identifier_spec.rbc +329 -0
  60. metadata +128 -0
@@ -0,0 +1,13 @@
1
+ require 'spec_helper'
2
+
3
+ describe Lumberjack::Formatter::InspectFormatter do
4
+
5
+ it "should format objects as string by calling their inspect method" do
6
+ formatter = Lumberjack::Formatter::InspectFormatter.new
7
+ formatter.call("abc").should == "\"abc\""
8
+ formatter.call(:test).should == ":test"
9
+ formatter.call(1).should == "1"
10
+ formatter.call([:a, 1, "b"]).should == [:a, 1, "b"].inspect
11
+ end
12
+
13
+ end
@@ -0,0 +1,360 @@
1
+ !RBIX
2
+ 0
3
+ x
4
+ M
5
+ 1
6
+ n
7
+ n
8
+ x
9
+ 10
10
+ __script__
11
+ i
12
+ 26
13
+ 5
14
+ 7
15
+ 0
16
+ 64
17
+ 47
18
+ 49
19
+ 1
20
+ 1
21
+ 15
22
+ 5
23
+ 45
24
+ 2
25
+ 3
26
+ 43
27
+ 4
28
+ 43
29
+ 5
30
+ 56
31
+ 6
32
+ 47
33
+ 50
34
+ 7
35
+ 1
36
+ 15
37
+ 2
38
+ 11
39
+ I
40
+ 3
41
+ I
42
+ 0
43
+ I
44
+ 0
45
+ I
46
+ 0
47
+ n
48
+ p
49
+ 8
50
+ s
51
+ 11
52
+ spec_helper
53
+ x
54
+ 7
55
+ require
56
+ x
57
+ 10
58
+ Lumberjack
59
+ n
60
+ x
61
+ 9
62
+ Formatter
63
+ x
64
+ 16
65
+ InspectFormatter
66
+ M
67
+ 1
68
+ p
69
+ 2
70
+ x
71
+ 9
72
+ for_block
73
+ t
74
+ n
75
+ x
76
+ 9
77
+ __block__
78
+ i
79
+ 11
80
+ 5
81
+ 7
82
+ 0
83
+ 64
84
+ 56
85
+ 1
86
+ 47
87
+ 50
88
+ 2
89
+ 1
90
+ 11
91
+ I
92
+ 4
93
+ I
94
+ 0
95
+ I
96
+ 0
97
+ I
98
+ 0
99
+ I
100
+ -2
101
+ p
102
+ 3
103
+ s
104
+ 63
105
+ should format objects as string by calling their inspect method
106
+ M
107
+ 1
108
+ p
109
+ 2
110
+ x
111
+ 9
112
+ for_block
113
+ t
114
+ n
115
+ x
116
+ 9
117
+ __block__
118
+ i
119
+ 109
120
+ 45
121
+ 0
122
+ 1
123
+ 43
124
+ 2
125
+ 43
126
+ 3
127
+ 13
128
+ 71
129
+ 4
130
+ 47
131
+ 9
132
+ 25
133
+ 47
134
+ 49
135
+ 5
136
+ 0
137
+ 13
138
+ 47
139
+ 49
140
+ 6
141
+ 0
142
+ 15
143
+ 8
144
+ 28
145
+ 49
146
+ 4
147
+ 0
148
+ 19
149
+ 0
150
+ 15
151
+ 20
152
+ 0
153
+ 7
154
+ 7
155
+ 64
156
+ 49
157
+ 8
158
+ 1
159
+ 49
160
+ 9
161
+ 0
162
+ 7
163
+ 10
164
+ 64
165
+ 83
166
+ 11
167
+ 15
168
+ 20
169
+ 0
170
+ 7
171
+ 12
172
+ 49
173
+ 8
174
+ 1
175
+ 49
176
+ 9
177
+ 0
178
+ 7
179
+ 13
180
+ 64
181
+ 83
182
+ 11
183
+ 15
184
+ 20
185
+ 0
186
+ 79
187
+ 49
188
+ 8
189
+ 1
190
+ 49
191
+ 9
192
+ 0
193
+ 7
194
+ 14
195
+ 64
196
+ 83
197
+ 11
198
+ 15
199
+ 20
200
+ 0
201
+ 7
202
+ 15
203
+ 79
204
+ 7
205
+ 16
206
+ 64
207
+ 35
208
+ 3
209
+ 49
210
+ 8
211
+ 1
212
+ 49
213
+ 9
214
+ 0
215
+ 7
216
+ 15
217
+ 79
218
+ 7
219
+ 16
220
+ 64
221
+ 35
222
+ 3
223
+ 49
224
+ 17
225
+ 0
226
+ 83
227
+ 11
228
+ 11
229
+ I
230
+ 6
231
+ I
232
+ 1
233
+ I
234
+ 0
235
+ I
236
+ 0
237
+ I
238
+ -2
239
+ p
240
+ 18
241
+ x
242
+ 10
243
+ Lumberjack
244
+ n
245
+ x
246
+ 9
247
+ Formatter
248
+ x
249
+ 16
250
+ InspectFormatter
251
+ x
252
+ 3
253
+ new
254
+ x
255
+ 8
256
+ allocate
257
+ x
258
+ 10
259
+ initialize
260
+ s
261
+ 3
262
+ abc
263
+ x
264
+ 4
265
+ call
266
+ x
267
+ 6
268
+ should
269
+ s
270
+ 5
271
+ "abc"
272
+ x
273
+ 2
274
+ ==
275
+ x
276
+ 4
277
+ test
278
+ s
279
+ 5
280
+ :test
281
+ s
282
+ 1
283
+ 1
284
+ x
285
+ 1
286
+ a
287
+ s
288
+ 1
289
+ b
290
+ x
291
+ 7
292
+ inspect
293
+ p
294
+ 11
295
+ I
296
+ 0
297
+ I
298
+ 6
299
+ I
300
+ 1f
301
+ I
302
+ 7
303
+ I
304
+ 30
305
+ I
306
+ 8
307
+ I
308
+ 40
309
+ I
310
+ 9
311
+ I
312
+ 4f
313
+ I
314
+ a
315
+ I
316
+ 6d
317
+ x
318
+ 79
319
+ /Users/bdurand/dev/projects/lumberjack/spec/formatter/inspect_formatter_spec.rb
320
+ p
321
+ 1
322
+ x
323
+ 9
324
+ formatter
325
+ x
326
+ 2
327
+ it
328
+ p
329
+ 3
330
+ I
331
+ 0
332
+ I
333
+ 5
334
+ I
335
+ b
336
+ x
337
+ 79
338
+ /Users/bdurand/dev/projects/lumberjack/spec/formatter/inspect_formatter_spec.rb
339
+ p
340
+ 0
341
+ x
342
+ 8
343
+ describe
344
+ p
345
+ 5
346
+ I
347
+ 0
348
+ I
349
+ 1
350
+ I
351
+ 9
352
+ I
353
+ 3
354
+ I
355
+ 1a
356
+ x
357
+ 79
358
+ /Users/bdurand/dev/projects/lumberjack/spec/formatter/inspect_formatter_spec.rb
359
+ p
360
+ 0
@@ -0,0 +1,14 @@
1
+ require 'spec_helper'
2
+
3
+ describe Lumberjack::Formatter::PrettyPrintFormatter do
4
+
5
+ it "should convert an object to a string using pretty print" do
6
+ object = Object.new
7
+ def object.pretty_print(q)
8
+ q.text "woot!"
9
+ end
10
+ formatter = Lumberjack::Formatter::PrettyPrintFormatter.new
11
+ formatter.call(object).should == "woot!"
12
+ end
13
+
14
+ end
@@ -0,0 +1,380 @@
1
+ !RBIX
2
+ 0
3
+ x
4
+ M
5
+ 1
6
+ n
7
+ n
8
+ x
9
+ 10
10
+ __script__
11
+ i
12
+ 26
13
+ 5
14
+ 7
15
+ 0
16
+ 64
17
+ 47
18
+ 49
19
+ 1
20
+ 1
21
+ 15
22
+ 5
23
+ 45
24
+ 2
25
+ 3
26
+ 43
27
+ 4
28
+ 43
29
+ 5
30
+ 56
31
+ 6
32
+ 47
33
+ 50
34
+ 7
35
+ 1
36
+ 15
37
+ 2
38
+ 11
39
+ I
40
+ 3
41
+ I
42
+ 0
43
+ I
44
+ 0
45
+ I
46
+ 0
47
+ n
48
+ p
49
+ 8
50
+ s
51
+ 11
52
+ spec_helper
53
+ x
54
+ 7
55
+ require
56
+ x
57
+ 10
58
+ Lumberjack
59
+ n
60
+ x
61
+ 9
62
+ Formatter
63
+ x
64
+ 20
65
+ PrettyPrintFormatter
66
+ M
67
+ 1
68
+ p
69
+ 2
70
+ x
71
+ 9
72
+ for_block
73
+ t
74
+ n
75
+ x
76
+ 9
77
+ __block__
78
+ i
79
+ 11
80
+ 5
81
+ 7
82
+ 0
83
+ 64
84
+ 56
85
+ 1
86
+ 47
87
+ 50
88
+ 2
89
+ 1
90
+ 11
91
+ I
92
+ 4
93
+ I
94
+ 0
95
+ I
96
+ 0
97
+ I
98
+ 0
99
+ I
100
+ -2
101
+ p
102
+ 3
103
+ s
104
+ 55
105
+ should convert an object to a string using pretty print
106
+ M
107
+ 1
108
+ p
109
+ 2
110
+ x
111
+ 9
112
+ for_block
113
+ t
114
+ n
115
+ x
116
+ 9
117
+ __block__
118
+ i
119
+ 86
120
+ 45
121
+ 0
122
+ 1
123
+ 13
124
+ 71
125
+ 2
126
+ 47
127
+ 9
128
+ 21
129
+ 47
130
+ 49
131
+ 3
132
+ 0
133
+ 13
134
+ 47
135
+ 49
136
+ 4
137
+ 0
138
+ 15
139
+ 8
140
+ 24
141
+ 49
142
+ 2
143
+ 0
144
+ 19
145
+ 0
146
+ 15
147
+ 99
148
+ 7
149
+ 5
150
+ 7
151
+ 6
152
+ 65
153
+ 20
154
+ 0
155
+ 49
156
+ 7
157
+ 4
158
+ 15
159
+ 45
160
+ 8
161
+ 9
162
+ 43
163
+ 10
164
+ 43
165
+ 11
166
+ 13
167
+ 71
168
+ 2
169
+ 47
170
+ 9
171
+ 64
172
+ 47
173
+ 49
174
+ 3
175
+ 0
176
+ 13
177
+ 47
178
+ 49
179
+ 4
180
+ 0
181
+ 15
182
+ 8
183
+ 67
184
+ 49
185
+ 2
186
+ 0
187
+ 19
188
+ 1
189
+ 15
190
+ 20
191
+ 1
192
+ 20
193
+ 0
194
+ 49
195
+ 12
196
+ 1
197
+ 49
198
+ 13
199
+ 0
200
+ 7
201
+ 14
202
+ 64
203
+ 83
204
+ 15
205
+ 11
206
+ I
207
+ 8
208
+ I
209
+ 2
210
+ I
211
+ 0
212
+ I
213
+ 0
214
+ I
215
+ -2
216
+ p
217
+ 16
218
+ x
219
+ 6
220
+ Object
221
+ n
222
+ x
223
+ 3
224
+ new
225
+ x
226
+ 8
227
+ allocate
228
+ x
229
+ 10
230
+ initialize
231
+ x
232
+ 12
233
+ pretty_print
234
+ M
235
+ 1
236
+ n
237
+ n
238
+ x
239
+ 12
240
+ pretty_print
241
+ i
242
+ 9
243
+ 20
244
+ 0
245
+ 7
246
+ 0
247
+ 64
248
+ 49
249
+ 1
250
+ 1
251
+ 11
252
+ I
253
+ 3
254
+ I
255
+ 1
256
+ I
257
+ 1
258
+ I
259
+ 1
260
+ n
261
+ p
262
+ 2
263
+ s
264
+ 5
265
+ woot!
266
+ x
267
+ 4
268
+ text
269
+ p
270
+ 5
271
+ I
272
+ -1
273
+ I
274
+ 7
275
+ I
276
+ 0
277
+ I
278
+ 8
279
+ I
280
+ 9
281
+ x
282
+ 84
283
+ /Users/bdurand/dev/projects/lumberjack/spec/formatter/pretty_print_formatter_spec.rb
284
+ p
285
+ 1
286
+ x
287
+ 1
288
+ q
289
+ x
290
+ 13
291
+ attach_method
292
+ x
293
+ 10
294
+ Lumberjack
295
+ n
296
+ x
297
+ 9
298
+ Formatter
299
+ x
300
+ 20
301
+ PrettyPrintFormatter
302
+ x
303
+ 4
304
+ call
305
+ x
306
+ 6
307
+ should
308
+ s
309
+ 5
310
+ woot!
311
+ x
312
+ 2
313
+ ==
314
+ p
315
+ 9
316
+ I
317
+ 0
318
+ I
319
+ 6
320
+ I
321
+ 1b
322
+ I
323
+ 7
324
+ I
325
+ 27
326
+ I
327
+ a
328
+ I
329
+ 46
330
+ I
331
+ b
332
+ I
333
+ 56
334
+ x
335
+ 84
336
+ /Users/bdurand/dev/projects/lumberjack/spec/formatter/pretty_print_formatter_spec.rb
337
+ p
338
+ 2
339
+ x
340
+ 6
341
+ object
342
+ x
343
+ 9
344
+ formatter
345
+ x
346
+ 2
347
+ it
348
+ p
349
+ 3
350
+ I
351
+ 0
352
+ I
353
+ 5
354
+ I
355
+ b
356
+ x
357
+ 84
358
+ /Users/bdurand/dev/projects/lumberjack/spec/formatter/pretty_print_formatter_spec.rb
359
+ p
360
+ 0
361
+ x
362
+ 8
363
+ describe
364
+ p
365
+ 5
366
+ I
367
+ 0
368
+ I
369
+ 1
370
+ I
371
+ 9
372
+ I
373
+ 3
374
+ I
375
+ 1a
376
+ x
377
+ 84
378
+ /Users/bdurand/dev/projects/lumberjack/spec/formatter/pretty_print_formatter_spec.rb
379
+ p
380
+ 0