Audio-Daemon

 view release on metacpan or  search on metacpan

Daemon.pm  view on Meta::CPAN

}

sub debug { my $self = shift; return $self->log('debug', @_); }
sub info { my $self = shift; return $self->log('info', @_); }
sub error { my $self = shift; return $self->log('error', @_); }
sub crit { my $self = shift; return $self->log('crit', @_); }
sub warn { my $self = shift; return $self->log('warn', @_); }

sub log {
  my $self = shift;
  my @caller = caller(2);
  # print "caller line is ".$caller[2]."\n";
  # ($package, $filename, $line, $subroutine, $hasargs,
  #  $wantarray, $evaltext, $is_require, $hints, $bitmask)
  if (defined $self->{Log}) {
    &{$self->{Log}}(@_, @caller);
    return 1;
  } else {
    return 0;
  }
}

Daemon/Client.pm  view on Meta::CPAN

=item Port

The port the server is listening on (we snag whatever local port IO::Socket chooses).

=item Log

This takes a reference to a function that's called for logging purposes, the format passed in is:

=over 4

<type>, <msg>, [caller(1)]

where <type> is one of debug, info, error, crit, warn.  <msg> is the text message, and [caller] is 
the array returned by the second form of the perlfunc caller().  This will give you the method,
line number, etc. of where the messagee is coming from.  With this logging feature, I don't have to worry
about syslog, stdout, or how to report errors or debug info... you do!

=back 4

=over 4

=over 4

=head1 METHODS

Daemon/MPG123.pm  view on Meta::CPAN

=item Port

The local port to start listening and accepting commands on.

=item Log

This takes a reference to a function that's called for logging purposes, the format passed in is:

=over 4

<type>, <msg>, [caller(1)]

where <type> is one of debug, info, error, crit, warn.  <msg> is the text message, and [caller] is
the array returned by the second form of the perlfunc caller().  This will give you the method,
line number, etc. of where the messagee is coming from.  With this logging feature, I don't have to worry
about syslog, stdout, or how to report errors or debug info... you do!

=back 4

=item Allow, Deny

Access Control.  If you specify something for the Allow variable, it assumes everything not allowed will
be denied.  If you specify something to denied it assumes everything else is allowed.  Wither neither
set, everything is allowed.  It accepts multple formats all seperated by a comma for multiple entries:

Daemon/Shout.pm  view on Meta::CPAN

=item Port

The local port to start listening and accepting commands on.

=item Log

This takes a reference to a function that's called for logging purposes, the format passed in is:

=over 4

<type>, <msg>, [caller(1)]

where <type> is one of debug, info, error, crit, warn.  
<msg> is the text message, and [caller] is the array 
returned by the second form of the perlfunc caller().
This will give you the method, line number, etc. of 
where the messagee is coming from.  With this logging 
feature, I don't have to worry about syslog, stdout, 
or how to report errors or debug info... you do!

=back 4

=item Allow, Deny

Access Control.  If you specify something for the Allow 

Daemon/Xmms.pm  view on Meta::CPAN

=item Port

The local port to start listening and accepting commands on.

=item Log

This takes a reference to a function that's called for logging purposes, the format passed in is:

=over 4

<type>, <msg>, [caller(1)]

where <type> is one of debug, info, error, crit, warn.  <msg> is the text message, and [caller] is
the array returned by the second form of the perlfunc caller().  This will give you the method,
line number, etc. of where the messagee is coming from.  With this logging feature, I don't have to worry
about syslog, stdout, or how to report errors or debug info... you do!

=back 4

=item Allow, Deny

Access Control.  If you specify something for the Allow variable, it assumes everything not allowed will
be denied.  If you specify something to denied it assumes everything else is allowed.  Wither neither
set, everything is allowed.  It accepts multple formats all seperated by a comma for multiple entries:



( run in 0.490 second using v1.01-cache-2.11-cpan-a9ef4e587e4 )