[Mageia-dev] [soft-commits] [6435] Added a first log viewer module.

Guillaume Rousse guillomovitch at gmail.com
Mon Nov 12 10:06:44 CET 2012


I forgot this one...

Le 11/11/2012 19:13, root at mageia.org a écrit :
> +## Append a custom string to log view adding date
> +sub logText {
> +    my ($st) = @_;
> +    my $string = chomp_(`LC_ALL=C date '+%Y %b %d %T'`) . " " . $st . "\n";
> +    # `` return non utf8 and concat of non utf8 & utf8 is non utf8:
> +    c::set_tagged_utf8($string);
> +
> +    # log given text
> +    $logView->appendLines($string);
> +}
It is especially ugly to call external date binary, whereas perl has 
everything needed as builtin functions for this. See "time related 
functions" in perlfunc(1), and POSIX::strftime in POSIX(3pm) if you need 
a simple formation function.
-- 
BOFH excuse #66:

bit bucket overflow


More information about the Mageia-dev mailing list