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,26 @@
1
+ require 'spec_helper'
2
+
3
+ describe Lumberjack::Rack::UnitOfWork do
4
+
5
+ it "should create a unit of work in a middleware stack" do
6
+ app = lambda{|env| [200, {"Content-Type" => env["Content-Type"], "Unit-Of-Work" => Lumberjack.unit_of_work_id.to_s}, ["OK"]]}
7
+ handler = Lumberjack::Rack::UnitOfWork.new(app)
8
+
9
+ response = handler.call("Content-Type" => "text/plain")
10
+ response[0].should == 200
11
+ response[1]["Content-Type"].should == "text/plain"
12
+ unit_of_work_1 = response[1]["Unit-Of-Work"]
13
+ response[2].should == ["OK"]
14
+
15
+ response = handler.call("Content-Type" => "text/html")
16
+ response[0].should == 200
17
+ response[1]["Content-Type"].should == "text/html"
18
+ unit_of_work_2 = response[1]["Unit-Of-Work"]
19
+ response[2].should == ["OK"]
20
+
21
+ unit_of_work_1.should_not == nil
22
+ unit_of_work_2.should_not == nil
23
+ unit_of_work_1.should_not == unit_of_work_2
24
+ end
25
+
26
+ end
@@ -0,0 +1,697 @@
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
+ 4
62
+ Rack
63
+ x
64
+ 10
65
+ UnitOfWork
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
+ 50
105
+ should create a unit of work in a middleware stack
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
+ 259
120
+ 5
121
+ 56
122
+ 0
123
+ 47
124
+ 50
125
+ 1
126
+ 0
127
+ 19
128
+ 0
129
+ 15
130
+ 45
131
+ 2
132
+ 3
133
+ 43
134
+ 4
135
+ 43
136
+ 5
137
+ 13
138
+ 71
139
+ 6
140
+ 47
141
+ 9
142
+ 37
143
+ 47
144
+ 49
145
+ 7
146
+ 0
147
+ 13
148
+ 20
149
+ 0
150
+ 47
151
+ 49
152
+ 8
153
+ 1
154
+ 15
155
+ 8
156
+ 42
157
+ 20
158
+ 0
159
+ 49
160
+ 6
161
+ 1
162
+ 19
163
+ 1
164
+ 15
165
+ 20
166
+ 1
167
+ 44
168
+ 43
169
+ 9
170
+ 79
171
+ 49
172
+ 10
173
+ 1
174
+ 13
175
+ 7
176
+ 11
177
+ 64
178
+ 7
179
+ 12
180
+ 64
181
+ 49
182
+ 13
183
+ 2
184
+ 15
185
+ 49
186
+ 14
187
+ 1
188
+ 19
189
+ 2
190
+ 15
191
+ 20
192
+ 2
193
+ 78
194
+ 49
195
+ 15
196
+ 1
197
+ 49
198
+ 16
199
+ 0
200
+ 4
201
+ 200
202
+ 83
203
+ 17
204
+ 15
205
+ 20
206
+ 2
207
+ 79
208
+ 49
209
+ 15
210
+ 1
211
+ 7
212
+ 11
213
+ 64
214
+ 49
215
+ 15
216
+ 1
217
+ 49
218
+ 16
219
+ 0
220
+ 7
221
+ 12
222
+ 64
223
+ 83
224
+ 17
225
+ 15
226
+ 20
227
+ 2
228
+ 79
229
+ 49
230
+ 15
231
+ 1
232
+ 7
233
+ 18
234
+ 64
235
+ 49
236
+ 15
237
+ 1
238
+ 19
239
+ 3
240
+ 15
241
+ 20
242
+ 2
243
+ 80
244
+ 49
245
+ 15
246
+ 1
247
+ 49
248
+ 16
249
+ 0
250
+ 7
251
+ 19
252
+ 64
253
+ 35
254
+ 1
255
+ 83
256
+ 17
257
+ 15
258
+ 20
259
+ 1
260
+ 44
261
+ 43
262
+ 9
263
+ 79
264
+ 49
265
+ 10
266
+ 1
267
+ 13
268
+ 7
269
+ 11
270
+ 64
271
+ 7
272
+ 20
273
+ 64
274
+ 49
275
+ 13
276
+ 2
277
+ 15
278
+ 49
279
+ 14
280
+ 1
281
+ 19
282
+ 2
283
+ 15
284
+ 20
285
+ 2
286
+ 78
287
+ 49
288
+ 15
289
+ 1
290
+ 49
291
+ 16
292
+ 0
293
+ 4
294
+ 200
295
+ 83
296
+ 17
297
+ 15
298
+ 20
299
+ 2
300
+ 79
301
+ 49
302
+ 15
303
+ 1
304
+ 7
305
+ 11
306
+ 64
307
+ 49
308
+ 15
309
+ 1
310
+ 49
311
+ 16
312
+ 0
313
+ 7
314
+ 20
315
+ 64
316
+ 83
317
+ 17
318
+ 15
319
+ 20
320
+ 2
321
+ 79
322
+ 49
323
+ 15
324
+ 1
325
+ 7
326
+ 18
327
+ 64
328
+ 49
329
+ 15
330
+ 1
331
+ 19
332
+ 4
333
+ 15
334
+ 20
335
+ 2
336
+ 80
337
+ 49
338
+ 15
339
+ 1
340
+ 49
341
+ 16
342
+ 0
343
+ 7
344
+ 19
345
+ 64
346
+ 35
347
+ 1
348
+ 83
349
+ 17
350
+ 15
351
+ 20
352
+ 3
353
+ 49
354
+ 21
355
+ 0
356
+ 1
357
+ 83
358
+ 17
359
+ 15
360
+ 20
361
+ 4
362
+ 49
363
+ 21
364
+ 0
365
+ 1
366
+ 83
367
+ 17
368
+ 15
369
+ 20
370
+ 3
371
+ 49
372
+ 21
373
+ 0
374
+ 20
375
+ 4
376
+ 83
377
+ 17
378
+ 11
379
+ I
380
+ b
381
+ I
382
+ 5
383
+ I
384
+ 0
385
+ I
386
+ 0
387
+ I
388
+ -2
389
+ p
390
+ 22
391
+ M
392
+ 1
393
+ p
394
+ 2
395
+ x
396
+ 9
397
+ for_block
398
+ t
399
+ n
400
+ x
401
+ 9
402
+ __block__
403
+ i
404
+ 54
405
+ 57
406
+ 19
407
+ 0
408
+ 15
409
+ 4
410
+ 200
411
+ 44
412
+ 43
413
+ 0
414
+ 80
415
+ 49
416
+ 1
417
+ 1
418
+ 13
419
+ 7
420
+ 2
421
+ 64
422
+ 20
423
+ 0
424
+ 7
425
+ 2
426
+ 64
427
+ 49
428
+ 3
429
+ 1
430
+ 49
431
+ 4
432
+ 2
433
+ 15
434
+ 13
435
+ 7
436
+ 5
437
+ 64
438
+ 45
439
+ 6
440
+ 7
441
+ 49
442
+ 8
443
+ 0
444
+ 49
445
+ 9
446
+ 0
447
+ 49
448
+ 4
449
+ 2
450
+ 15
451
+ 7
452
+ 10
453
+ 64
454
+ 35
455
+ 1
456
+ 35
457
+ 3
458
+ 11
459
+ I
460
+ 8
461
+ I
462
+ 1
463
+ I
464
+ 1
465
+ I
466
+ 1
467
+ n
468
+ p
469
+ 11
470
+ x
471
+ 4
472
+ Hash
473
+ x
474
+ 16
475
+ new_from_literal
476
+ s
477
+ 12
478
+ Content-Type
479
+ x
480
+ 2
481
+ []
482
+ x
483
+ 3
484
+ []=
485
+ s
486
+ 12
487
+ Unit-Of-Work
488
+ x
489
+ 10
490
+ Lumberjack
491
+ n
492
+ x
493
+ 15
494
+ unit_of_work_id
495
+ x
496
+ 4
497
+ to_s
498
+ s
499
+ 2
500
+ OK
501
+ p
502
+ 3
503
+ I
504
+ 0
505
+ I
506
+ 6
507
+ I
508
+ 36
509
+ x
510
+ 69
511
+ /Users/bdurand/dev/projects/lumberjack/spec/rack/unit_of_work_spec.rb
512
+ p
513
+ 1
514
+ x
515
+ 3
516
+ env
517
+ x
518
+ 6
519
+ lambda
520
+ x
521
+ 10
522
+ Lumberjack
523
+ n
524
+ x
525
+ 4
526
+ Rack
527
+ x
528
+ 10
529
+ UnitOfWork
530
+ x
531
+ 3
532
+ new
533
+ x
534
+ 8
535
+ allocate
536
+ x
537
+ 10
538
+ initialize
539
+ x
540
+ 4
541
+ Hash
542
+ x
543
+ 16
544
+ new_from_literal
545
+ s
546
+ 12
547
+ Content-Type
548
+ s
549
+ 10
550
+ text/plain
551
+ x
552
+ 3
553
+ []=
554
+ x
555
+ 4
556
+ call
557
+ x
558
+ 2
559
+ []
560
+ x
561
+ 6
562
+ should
563
+ x
564
+ 2
565
+ ==
566
+ s
567
+ 12
568
+ Unit-Of-Work
569
+ s
570
+ 2
571
+ OK
572
+ s
573
+ 9
574
+ text/html
575
+ x
576
+ 10
577
+ should_not
578
+ p
579
+ 31
580
+ I
581
+ 0
582
+ I
583
+ 6
584
+ I
585
+ a
586
+ I
587
+ 7
588
+ I
589
+ 2d
590
+ I
591
+ 9
592
+ I
593
+ 47
594
+ I
595
+ a
596
+ I
597
+ 55
598
+ I
599
+ b
600
+ I
601
+ 6a
602
+ I
603
+ c
604
+ I
605
+ 79
606
+ I
607
+ d
608
+ I
609
+ 8a
610
+ I
611
+ f
612
+ I
613
+ a4
614
+ I
615
+ 10
616
+ I
617
+ b2
618
+ I
619
+ 11
620
+ I
621
+ c7
622
+ I
623
+ 12
624
+ I
625
+ d6
626
+ I
627
+ 13
628
+ I
629
+ e7
630
+ I
631
+ 15
632
+ I
633
+ f0
634
+ I
635
+ 16
636
+ I
637
+ f9
638
+ I
639
+ 17
640
+ I
641
+ 103
642
+ x
643
+ 69
644
+ /Users/bdurand/dev/projects/lumberjack/spec/rack/unit_of_work_spec.rb
645
+ p
646
+ 5
647
+ x
648
+ 3
649
+ app
650
+ x
651
+ 7
652
+ handler
653
+ x
654
+ 8
655
+ response
656
+ x
657
+ 14
658
+ unit_of_work_1
659
+ x
660
+ 14
661
+ unit_of_work_2
662
+ x
663
+ 2
664
+ it
665
+ p
666
+ 3
667
+ I
668
+ 0
669
+ I
670
+ 5
671
+ I
672
+ b
673
+ x
674
+ 69
675
+ /Users/bdurand/dev/projects/lumberjack/spec/rack/unit_of_work_spec.rb
676
+ p
677
+ 0
678
+ x
679
+ 8
680
+ describe
681
+ p
682
+ 5
683
+ I
684
+ 0
685
+ I
686
+ 1
687
+ I
688
+ 9
689
+ I
690
+ 3
691
+ I
692
+ 1a
693
+ x
694
+ 69
695
+ /Users/bdurand/dev/projects/lumberjack/spec/rack/unit_of_work_spec.rb
696
+ p
697
+ 0