File: rrconfig.xml

package info (click to toggle)
ruby-log4r 1.1.10-4.1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid, trixie
  • size: 648 kB
  • sloc: ruby: 2,744; xml: 96; makefile: 5
file content (63 lines) | stat: -rw-r--r-- 2,800 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<!-- This is a real config file used by a game that I'm working on 
     The Ruby file that loads this is rrsetup.rb -->
<log4r_config>
  <pre_config>
    <!-- I like having a ton of levels. There are three extra for component
         data, comp1..3 and one level for object dumps (DATA) -->
    <custom_levels>
      COMP3, COMP2, COMP1, DATA, DEBUG, INFO, WARN, ERROR, FATAL
    </custom_levels>
    <!-- change to ERROR when the game goes to production -->
    <global level="ALL"/>
  </pre_config>

  <!-- Outputters -->

  <!-- game.log records DEBUG and higher, so no game component data -->
  <outputter name="gameout" type="FileOutputter" level="DEBUG">
    <!-- I set the logpath from within the game. -->
    <filename>#{logpath}/game.log</filename>
  </outputter>
  <!-- DATA level goes to its own special file. These log events are
       too noisy for game.log and are not game components. Useful
       for dumping lots of objects during development. -->
  <outputter name="gamedata" type="FileOutputter" only_at="DATA">
    <filename>#{logpath}/data.log</filename>
    <!-- low-noise custom formatter for objects -->
    <formatter type="CompFormatter"/>
  </outputter>
  <!-- Spit any errors to the console. They merit special attention -->
  <outputter name="console" type="StderrOutputter" level="ERROR"/>
  <!-- A separate log file for tracking game components, 
       used for development. It logs ALL-->
  <outputter name="componentout" type="FileOutputter">
    <filename>#{logpath}/component.log</filename>
    <formatter type="CompFormatter"/>
  </outputter>

  <!-- Loggers -->

  <!-- 'game' is the main logger for the client-server framework -->
  <logger name="game" level="DATA" additive="false" trace="true">
    <outputters>gameout, gamedata, console</outputters>
  </logger>
  <!-- Notice how we have fine control over how each element logs.
       The gui and controller are stable while the rest are being debugged. -->
  <logger name="game::gui" level="ERROR" additive="true" trace="true"/>
  <logger name="game::boardgui" level="DEBUG" additive="true" trace="false"/>
  <logger name="game::server" level="DEBUG" additive="true" trace="true"/>
  <logger name="game::client" level="DEBUG" additive="true" trace="true"/>
  <logger name="game::controller" level="ERROR" additive="true" trace="false"/>

  <!-- 'component' is the main logger for game objects. It's used in
       development to track how the objects change with time. -->
  <logger name="component" level="ALL" additive="false" trace="false">
    <outputter>componentout</outputter>
    <outputter>console</outputter>
  </logger>
  <logger name="component::board"/>
  <logger name="component::tile"/>
  <logger name="component::player"/>
  <logger name="component::player::robot"/>
 
</log4r_config>