Changeset 9c1e3377
- Timestamp:
- Aug 5, 2017, 11:23:15 PM (8 years ago)
- Children:
- dd96101
- Parents:
- f065a96
- git-author:
- Jason Gross <jgross@mit.edu> (01/05/14 18:08:28)
- git-committer:
- Jason Gross <jgross@mit.edu> (08/05/17 23:23:15)
- Location:
- perl/lib/BarnOwl
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
perl/lib/BarnOwl/Logging.pm
rbb8ad8f r9c1e3377 120 120 . "Files will be created in the directory for each class." 121 121 }); 122 123 BarnOwl::new_variable_bool('log-to-subdirectories', 124 { 125 default => 0, 126 summary => "log each protocol to its own subdirectory of logbasepath", 127 description => "When this is enabled, BarnOwl will log each protocol to its own\n" 128 . "subdirectory of logbasepath. When this is disabled, BarnOwl will\n" 129 . "instead log all non-zephyr non-loopback messages to the logpath,\n" 130 . "and prefix each filename with what would otherwise be the subdirectory\n" 131 . "name.\n\n" 132 . "If you enable this, be sure that the relevant directories exist;\n" 133 . "BarnOwl will not create them for you." 134 }); 135 122 136 } 123 137 -
perl/lib/BarnOwl/Message.pm
r858d094 r9c1e3377 183 183 } 184 184 $filename = "unknown" if !defined($filename) || $filename eq ''; 185 return ($filename); 185 if (BarnOwl::getvar('log-to-subdirectories') eq 'on') { 186 return ($filename); 187 } else { 188 return ($m->log_subfolder . ':' . $filename); 189 } 186 190 } 187 191 … … 205 209 Returns the folder in which all messages of this class get logged. 206 210 207 Defaults to C<log_base_path>/C<log_subfolder>. 211 Defaults to C<log_base_path/log_subfolder> if C<log-to-subdirectories> 212 is enabled, or to the C<logpath> BarnOwl variable if it is not. 213 214 Most protocols should override C<log_subfolder> rather than 215 C<log_path>, in order to properly take into account the value of 216 C<log-to-subdirectories>. 208 217 209 218 =cut … … 211 220 sub log_path { 212 221 my ($m) = @_; 213 return File::Spec->catfile($m->log_base_path, $m->log_subfolder); 222 if (BarnOwl::getvar('log-to-subdirectories') eq 'on') { 223 return File::Spec->catfile($m->log_base_path, $m->log_subfolder); 224 } else { 225 return BarnOwl::getvar('logpath'); 226 } 214 227 } 215 228
Note: See TracChangeset
for help on using the changeset viewer.