Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log::Dispatch::File : add reopen() method #30

Open
autarch opened this issue Nov 14, 2016 · 2 comments
Open

Log::Dispatch::File : add reopen() method #30

autarch opened this issue Nov 14, 2016 · 2 comments

Comments

@autarch
Copy link
Member

autarch commented Nov 14, 2016

Migrated from rt.cpan.org #47513 (status was 'open')

Requestors:

From dolmen@cpan.org (@dolmen) on 2009-07-02 15:55:25:

Adding a reopen() method (that just closes/opens the file handle) would
ease the implementation of log rotation using external tools such as
logrotate.

The implementation in the Log::Dispatch::File class would benefit to all
its subclasses such as Log::Dispatch::File::Rolling.

@autarch
Copy link
Member Author

autarch commented Nov 14, 2016

From drolsky@cpan.org (@autarch) on 2009-09-12 16:27:22:

On Thu Jul 02 11:55:25 2009, DOLMEN wrote:

Adding a reopen() method (that just closes/opens the file handle) would
ease the implementation of log rotation using external tools such as
logrotate.

The implementation in the Log::Dispatch::File class would benefit to all
its subclasses such as Log::Dispatch::File::Rolling.

Did you mean to attach a patch to this?

@autarch
Copy link
Member Author

autarch commented Nov 14, 2016

From dolmen@cpan.org (@dolmen) on 2009-09-21 14:01:00:

Le Sam. Sep. 12 12:27:22 2009, DROLSKY a écrit :

Did you mean to attach a patch to this?

Here is an implementation:

sub reopen()
{
unless ($self->{close}) {
close($self->{fh}) if exists $self->{fh};
$self->_open_file;
}
}

Doc and tests still have to be written :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant