Log::Info::Fork - a process that forks, and its output is captured and logged.


Log-Info documentation  | view source Contained in the Log-Info distribution.

Index


NAME

Top

Log::Info::Fork - a process that forks, and its output is captured and logged.

SYNOPSIS

Top

DESCRIPTION

Top

CLASS CONSTANTS

Top

CLASS COMPONENTS

Top

CLASS HIGHER-LEVEL FUNCTIONS

Top

fork_log

Fork, and log the output of the child.

ARGUMENTS

proc

What to execute in the child. Either as an arrayref, being the name & args of a process to execute, or as a coderef.

fhs

Optional. If defined, an arrayref of hashrefs, each having keys:

fh

A filehandle object, or a (non-negative) integer specifying a file descriptor.

channel

Optional The channel (name) to log to. Defaults to CHAN_INFO.

level

Optional The level (name) to log at. Defaults to LOG_INFO.

If not defined, defaults to logging stdout to CHAN_INFO at LOG_INFO, and stderr to CHAN_INFO at LOG_WARNING.

log_opts

Optional.

This value is actually a bitmask. The recognized bits are:

1

Log the process start/end with name (see the name argument). This gets logged to CHAN_INFO at LOG_INFO level.

2

Log the process arguments (if a process passed), attempt to deparse code (if code passwd).

4

Log process results (as exit code if exec, or eval results if code).

name

Optional A name used for messages relating to this fork.

format

Optional A coderef for formatting messages. The ref is passed the following arguments:

channnel name
log level
source

filehandle name, or an SRC_ constant.

message

The coderef is expected to return a string.

RETURNS

  • The exit status for an execd process (i.e., the value of $?).

CLASS HIGHER-LEVEL PROCEDURES

Top

INSTANCE CONSTRUCTION

Top

new

Create & return a new thing.

INSTANCE COMPONENTS

Top

INSTANCE HIGHER-LEVEL FUNCTIONS

Top

INSTANCE HIGHER-LEVEL PROCEDURES

Top

fork

Fork, passing any parameters to the procedure.

EXAMPLES

Top

BUGS

Top

REPORTING BUGS

Top

Email the author.

AUTHOR

Top

Martyn J. Pearce fluffy@cpan.org

COPYRIGHT

Top

SEE ALSO

Top


Log-Info documentation  | view source Contained in the Log-Info distribution.