Changeset 381

Show
Ignore:
Timestamp:
12/18/01 20:49:20
Author:
miyagawa
Message:

doc tweak

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • Log-Dispatch-Config/trunk/README

    r379 r381  
    5858      screen.format = %m 
    5959 
    60     In this example, config file is written in AppConfig format. Using . ini 
    61     style config file is also okay. See the 
    62     Log::Dispatch::Configurator::AppConfig manpage for the details. 
     60    In this example, config file is written in AppConfig format. See the 
     61    Log::Dispatch::Configurator::AppConfig manpage for details. 
    6362 
    6463    See the section on "PLUGGABLE CONFIGURATOR" for other config parsing 
     
    103102    "name" is the name of each one, defined in global "dispatchers" 
    104103    parameter. 
     104 
     105    You can also use ".ini" style grouping like: 
     106 
     107      [foo] 
     108      class = Log::Dispatch::File 
     109      min_level = debug 
     110 
     111    See the Log::Dispatch::Configurator::AppConfig manpage for details. 
    105112 
    106113    class 
     
    201208          } 
    202209 
    203     *   Implement optional "needs_reload" and "reload" method
     210    *   Implement optional "needs_reload" and "reload" methods
    204211        "needs_reload" accepts Log::Dispatch::Config instance and should 
    205212        return boolean value if the object is stale and needs reloading 
     
    214221              return $obj->{ctime} < (stat($self->{file}))[9]; 
    215222          } 
     223 
     224        If you do not need *singleton-ness*, always return true. 
     225 
     226          sub needs_reload { 1 } 
    216227 
    217228        "reload" method is called when "needs_reload" returns true, and 
     
    227238          } 
    228239 
    229     *   Thats all. Now you can plug your own configurator (Hardwired) into 
     240    *   That's all. Now you can plug your own configurator (Hardwired) into 
    230241        Log::Dispatch::Config. What you should do is to pass configurator 
    231242        object to "configure" method call instead of config file name. 
  • Log-Dispatch-Config/trunk/lib/Log/Dispatch/Config.pm

    r379 r381  
    218218  screen.format = %m 
    219219 
    220 In this example, config file is written in AppConfig format. Using . 
    221 ini style config file is also okay. See 
    222 L<Log::Dispatch::Configurator::AppConfig> for the details. 
     220In this example, config file is written in AppConfig format. See 
     221L<Log::Dispatch::Configurator::AppConfig> for details. 
    223222 
    224223See L</"PLUGGABLE CONFIGURATOR"> for other config parsing scheme. 
     
    268267"name" is the name of each one, defined in global C<dispatchers> 
    269268parameter. 
     269 
     270You can also use C<.ini> style grouping like: 
     271 
     272  [foo] 
     273  class = Log::Dispatch::File 
     274  min_level = debug 
     275 
     276See L<Log::Dispatch::Configurator::AppConfig> for details. 
    270277 
    271278=over 4 
     
    382389 
    383390Implement optional C<needs_reload> and C<reload> 
    384 method. C<needs_reload> accepts Log::Dispatch::Config instance and 
     391methods. C<needs_reload> accepts Log::Dispatch::Config instance and 
    385392should return boolean value if the object is stale and needs reloading 
    386393itself. 
     
    394401      return $obj->{ctime} < (stat($self->{file}))[9]; 
    395402  } 
     403 
     404If you do not need I<singleton-ness>, always return true. 
     405 
     406  sub needs_reload { 1 } 
    396407 
    397408C<reload> method is called when C<needs_reload> returns true, and 
     
    409420=item * 
    410421 
    411 Thats all. Now you can plug your own configurator (Hardwired) into 
     422That's all. Now you can plug your own configurator (Hardwired) into 
    412423Log::Dispatch::Config. What you should do is to pass configurator 
    413424object to C<configure> method call instead of config file name.