Ivan Baidakou

NAME

App::PerlWatcher::Watcher::FileTail - Watches for changes file and outputs new added lines (a-la 'tail -f')

VERSION

version 0.18

SYNOPSIS

Use the following config for Engine to monitor file changes online:

        {
            class => 'App::PerlWatcher::Watcher::FileTail',
            config => {
                file            =>  '/var/log/messages',
                lines_number    =>  10,
                filter          => sub { $_ !~ /\scron/ },
            },
        },

DESCRIPTION

The more detailed description of PerlWatcher application can be found here: https://github.com/basiliscos/perl-watcher.

ATTRIBUTES

file

The file to be watched.

lines_number

The number of at the file tail, which are to be displayed

filter

The function, which will filter file tail lines, which will not be displayed/taken into account, e.g.

 sub { $_ !~ /\scron/ }

- that omits all lines with 'cron' string

inotify

The inotify object

events

All gathered lines

reverse

Emits lines in revers order, like tail -f, i.e. the new ones come at the top.

Default value: false

AUTHOR

Ivan Baidakou <dmol@gmx.com>

COPYRIGHT AND LICENSE

This software is copyright (c) 2014 by Ivan Baidakou.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.