Ignore:
Timestamp:
Aug 5, 2017, 11:23:11 PM (7 years ago)
Author:
Jason Gross <jgross@mit.edu>
Children:
7553744
Parents:
ac4774f
git-author:
Jason Gross <jgross@mit.edu> (02/16/13 23:46:21)
git-committer:
Jason Gross <jgross@mit.edu> (08/05/17 23:23:11)
Message:
Log to subfolders of a base path

A different subfolder for each protocol.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • perl/lib/BarnOwl/Logging.pm

    r5ca4b4f r858d094  
    8989                           . "is selected both incoming and outgoing messages are\n"
    9090                           . "logged."
     91        });
     92
     93    BarnOwl::new_variable_string('logbasepath',
     94        {
     95            default       => '~/zlog',
     96            validsettings => '<path>',
     97            summary       => 'path for logging non-zephyr messages',
     98            description   => "Specifies a directory which must exist.\n"
     99                           . "Each non-zephyr protocol gets its own subdirectory in\n"
     100                           . "logbasepath, and messages get logged there."
    91101        });
    92102
     
    141151This method calls C<log_filenames> on C<MESSAGE> to determine the list
    142152of filenames to which C<MESSAGE> gets logged.  All filenames are
    143 relative to C<MESSAGE->log_base_path>.  If C<MESSAGE->log_to_all_file>
     153relative to C<MESSAGE->log_path>.  If C<MESSAGE->log_to_all_file>
    144154returns true, then the filename C<"all"> is appended to the list of
    145155filenames.
     
    153163    my @filenames = $m->log_filenames;
    154164    push @filenames, 'all' if $m->log_to_all_file;
    155     return map { sanitize_filename($m->log_base_path, $_) } @filenames;
     165    return map { sanitize_filename($m->log_path, $_) } @filenames;
    156166}
    157167
Note: See TracChangeset for help on using the changeset viewer.