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,22 @@
1
+ require 'spec_helper'
2
+
3
+ describe Lumberjack do
4
+
5
+ context "unit of work" do
6
+ it "should create a unit work with a unique id in a block" do
7
+ Lumberjack.unit_of_work_id.should == nil
8
+ Lumberjack.unit_of_work do
9
+ id_1 = Lumberjack.unit_of_work_id
10
+ id_1.should match(/^[0-9A-F]{12}$/)
11
+ Lumberjack.unit_of_work do
12
+ id_2 = Lumberjack.unit_of_work_id
13
+ id_2.should match(/^[0-9A-F]{12}$/)
14
+ id_2.should_not == id_1
15
+ end
16
+ id_1.should == Lumberjack.unit_of_work_id
17
+ end
18
+ Lumberjack.unit_of_work_id.should == nil
19
+ end
20
+ end
21
+
22
+ end
@@ -0,0 +1,523 @@
1
+ !RBIX
2
+ 0
3
+ x
4
+ M
5
+ 1
6
+ n
7
+ n
8
+ x
9
+ 10
10
+ __script__
11
+ i
12
+ 22
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
+ 56
27
+ 4
28
+ 47
29
+ 50
30
+ 5
31
+ 1
32
+ 15
33
+ 2
34
+ 11
35
+ I
36
+ 3
37
+ I
38
+ 0
39
+ I
40
+ 0
41
+ I
42
+ 0
43
+ n
44
+ p
45
+ 6
46
+ s
47
+ 11
48
+ spec_helper
49
+ x
50
+ 7
51
+ require
52
+ x
53
+ 10
54
+ Lumberjack
55
+ n
56
+ M
57
+ 1
58
+ p
59
+ 2
60
+ x
61
+ 9
62
+ for_block
63
+ t
64
+ n
65
+ x
66
+ 9
67
+ __block__
68
+ i
69
+ 11
70
+ 5
71
+ 7
72
+ 0
73
+ 64
74
+ 56
75
+ 1
76
+ 47
77
+ 50
78
+ 2
79
+ 1
80
+ 11
81
+ I
82
+ 4
83
+ I
84
+ 0
85
+ I
86
+ 0
87
+ I
88
+ 0
89
+ I
90
+ -2
91
+ p
92
+ 3
93
+ s
94
+ 12
95
+ unit of work
96
+ M
97
+ 1
98
+ p
99
+ 2
100
+ x
101
+ 9
102
+ for_block
103
+ t
104
+ n
105
+ x
106
+ 9
107
+ __block__
108
+ i
109
+ 11
110
+ 5
111
+ 7
112
+ 0
113
+ 64
114
+ 56
115
+ 1
116
+ 47
117
+ 50
118
+ 2
119
+ 1
120
+ 11
121
+ I
122
+ 4
123
+ I
124
+ 0
125
+ I
126
+ 0
127
+ I
128
+ 0
129
+ I
130
+ -2
131
+ p
132
+ 3
133
+ s
134
+ 53
135
+ should create a unit work with a unique id in a block
136
+ M
137
+ 1
138
+ p
139
+ 2
140
+ x
141
+ 9
142
+ for_block
143
+ t
144
+ n
145
+ x
146
+ 9
147
+ __block__
148
+ i
149
+ 35
150
+ 45
151
+ 0
152
+ 1
153
+ 49
154
+ 2
155
+ 0
156
+ 49
157
+ 3
158
+ 0
159
+ 1
160
+ 83
161
+ 4
162
+ 15
163
+ 45
164
+ 0
165
+ 5
166
+ 56
167
+ 6
168
+ 50
169
+ 7
170
+ 0
171
+ 15
172
+ 45
173
+ 0
174
+ 8
175
+ 49
176
+ 2
177
+ 0
178
+ 49
179
+ 3
180
+ 0
181
+ 1
182
+ 83
183
+ 4
184
+ 11
185
+ I
186
+ 3
187
+ I
188
+ 0
189
+ I
190
+ 0
191
+ I
192
+ 0
193
+ I
194
+ -2
195
+ p
196
+ 9
197
+ x
198
+ 10
199
+ Lumberjack
200
+ n
201
+ x
202
+ 15
203
+ unit_of_work_id
204
+ x
205
+ 6
206
+ should
207
+ x
208
+ 2
209
+ ==
210
+ n
211
+ M
212
+ 1
213
+ p
214
+ 2
215
+ x
216
+ 9
217
+ for_block
218
+ t
219
+ n
220
+ x
221
+ 9
222
+ __block__
223
+ i
224
+ 48
225
+ 45
226
+ 0
227
+ 1
228
+ 49
229
+ 2
230
+ 0
231
+ 19
232
+ 0
233
+ 15
234
+ 20
235
+ 0
236
+ 5
237
+ 45
238
+ 0
239
+ 3
240
+ 43
241
+ 4
242
+ 47
243
+ 49
244
+ 5
245
+ 1
246
+ 49
247
+ 6
248
+ 1
249
+ 15
250
+ 45
251
+ 0
252
+ 7
253
+ 56
254
+ 8
255
+ 50
256
+ 9
257
+ 0
258
+ 15
259
+ 20
260
+ 0
261
+ 49
262
+ 6
263
+ 0
264
+ 45
265
+ 0
266
+ 10
267
+ 49
268
+ 2
269
+ 0
270
+ 83
271
+ 11
272
+ 11
273
+ I
274
+ 5
275
+ I
276
+ 1
277
+ I
278
+ 0
279
+ I
280
+ 0
281
+ I
282
+ -2
283
+ p
284
+ 12
285
+ x
286
+ 10
287
+ Lumberjack
288
+ n
289
+ x
290
+ 15
291
+ unit_of_work_id
292
+ n
293
+ x
294
+ 16
295
+ UniqueIdentifier
296
+ x
297
+ 4
298
+ be_a
299
+ x
300
+ 6
301
+ should
302
+ n
303
+ M
304
+ 1
305
+ p
306
+ 2
307
+ x
308
+ 9
309
+ for_block
310
+ t
311
+ n
312
+ x
313
+ 9
314
+ __block__
315
+ i
316
+ 36
317
+ 45
318
+ 0
319
+ 1
320
+ 49
321
+ 2
322
+ 0
323
+ 19
324
+ 0
325
+ 15
326
+ 20
327
+ 0
328
+ 5
329
+ 45
330
+ 0
331
+ 3
332
+ 43
333
+ 4
334
+ 47
335
+ 49
336
+ 5
337
+ 1
338
+ 49
339
+ 6
340
+ 1
341
+ 15
342
+ 20
343
+ 0
344
+ 49
345
+ 7
346
+ 0
347
+ 21
348
+ 1
349
+ 0
350
+ 83
351
+ 8
352
+ 11
353
+ I
354
+ 5
355
+ I
356
+ 1
357
+ I
358
+ 0
359
+ I
360
+ 0
361
+ I
362
+ -2
363
+ p
364
+ 9
365
+ x
366
+ 10
367
+ Lumberjack
368
+ n
369
+ x
370
+ 15
371
+ unit_of_work_id
372
+ n
373
+ x
374
+ 16
375
+ UniqueIdentifier
376
+ x
377
+ 4
378
+ be_a
379
+ x
380
+ 6
381
+ should
382
+ x
383
+ 10
384
+ should_not
385
+ x
386
+ 2
387
+ ==
388
+ p
389
+ 7
390
+ I
391
+ 0
392
+ I
393
+ c
394
+ I
395
+ 9
396
+ I
397
+ d
398
+ I
399
+ 19
400
+ I
401
+ e
402
+ I
403
+ 24
404
+ x
405
+ 62
406
+ /Users/bdurand/dev/projects/lumberjack/spec/lumberjack_spec.rb
407
+ p
408
+ 1
409
+ x
410
+ 4
411
+ id_2
412
+ x
413
+ 12
414
+ unit_of_work
415
+ n
416
+ x
417
+ 2
418
+ ==
419
+ p
420
+ 9
421
+ I
422
+ 0
423
+ I
424
+ 9
425
+ I
426
+ 9
427
+ I
428
+ a
429
+ I
430
+ 19
431
+ I
432
+ b
433
+ I
434
+ 22
435
+ I
436
+ 10
437
+ I
438
+ 30
439
+ x
440
+ 62
441
+ /Users/bdurand/dev/projects/lumberjack/spec/lumberjack_spec.rb
442
+ p
443
+ 1
444
+ x
445
+ 4
446
+ id_1
447
+ x
448
+ 12
449
+ unit_of_work
450
+ n
451
+ p
452
+ 7
453
+ I
454
+ 0
455
+ I
456
+ 7
457
+ I
458
+ d
459
+ I
460
+ 8
461
+ I
462
+ 16
463
+ I
464
+ 12
465
+ I
466
+ 23
467
+ x
468
+ 62
469
+ /Users/bdurand/dev/projects/lumberjack/spec/lumberjack_spec.rb
470
+ p
471
+ 0
472
+ x
473
+ 2
474
+ it
475
+ p
476
+ 3
477
+ I
478
+ 0
479
+ I
480
+ 6
481
+ I
482
+ b
483
+ x
484
+ 62
485
+ /Users/bdurand/dev/projects/lumberjack/spec/lumberjack_spec.rb
486
+ p
487
+ 0
488
+ x
489
+ 7
490
+ context
491
+ p
492
+ 3
493
+ I
494
+ 0
495
+ I
496
+ 5
497
+ I
498
+ b
499
+ x
500
+ 62
501
+ /Users/bdurand/dev/projects/lumberjack/spec/lumberjack_spec.rb
502
+ p
503
+ 0
504
+ x
505
+ 8
506
+ describe
507
+ p
508
+ 5
509
+ I
510
+ 0
511
+ I
512
+ 1
513
+ I
514
+ 9
515
+ I
516
+ 3
517
+ I
518
+ 16
519
+ x
520
+ 62
521
+ /Users/bdurand/dev/projects/lumberjack/spec/lumberjack_spec.rb
522
+ p
523
+ 0