Imported Upstream version 3.2.0
[debian/amanda] / perl / Amanda / Logfile.pod
index 0663f44560dcaca1f92e7e6beb87399eadc7d8ac..6b5bf32116be36018a142c2f376d54ba13a28f5a 100644 (file)
@@ -86,20 +86,41 @@ C<$handle>, or nothing at the end of the logfile.
 
 =back
 
-To write a logfile, call C<log_add($logtype, $string)>.  On the first
-call, this function opens and locks C<$logdir/log>; subsequent calls
-just append to this file.  As such, this function is only appropriate
-for situations where C<amlogroll> will be invoked later to rename
-C<$logdir/log> to C<$logdir/log.$timestamp.$n>.
+=head3 Writing a "current" Logfile
+
+To write a logfile, call C<log_add($logtype, $string)>.  On the first call,
+this function opens and locks C<$logdir/log>; subsequent calls just append to
+this file.  As such, this function is only appropriate for situations where
+C<log_rename> will be invoked later to rename C<$logdir/log> to
+C<$logdir/log.$timestamp.$n>.
+
+If you need to write a log entry for another program, for example to simulate
+taper entries, call C<log_add_full($logtype, $pname, $string)>.
 
 All of the functions in this section can be imported by name if
 desired.
 
+=head3 Utilities
+
+Many trace log entries have a statistics entry in what used to be the error
+message slot, of the form C<[sec .. kb .. kps ..]>.  The function C<make_stats>
+will create such an entry for you:
+
+    make_stats($size, $duration, $orig_kb);
+
+Note that C<$orig_kb> can be undefined, in which case it will not appear in
+the statistics output.
+
 =head2 Amanda::Find::find_result_t objects
 
 These objects contain information about dumps, as read from logfiles.
 Instance variables are:
 
+To rename the current logfile to a datestamped logfile, call C<log_rename($ts)>
+where C<$ts> is the write timestamp for this dump.  The
+C<get_current_log_timestamp()> function will calculate this timestamp,
+returning C<undef> on error.
+
 =over
 
 =item C<timestamp>