Commit 4d97cbff authored by Ariel D'Alessandro's avatar Ariel D'Alessandro
Browse files

aptly: Add timestamp to log output



Currently, aptly module is logging to `/srv/obs/log/aptly.log` without a
timestamping, which makes it difficult to debug.

Signed-off-by: Ariel D'Alessandro's avatarAriel D'Alessandro <ariel.dalessandro@collabora.com>
parent 76a63bb2
Pipeline #41666 passed with stages
in 32 minutes and 36 seconds
......@@ -11,6 +11,7 @@ use BSPublisher::Util;
use BSRevision;
use BSUtil;
use Build::Deb;
use POSIX qw(strftime);
use strict;
......@@ -50,7 +51,8 @@ sub aptly_exec {
} elsif ($pid == 0) {
BSUtil::lockopen(*STDOUT, '>>', APTLY_LOG_FILE);
open(STDERR, '>&STDOUT');
print STDOUT ">>>>> aptly_exec: ".join(' ', @args)."\n";
my $timestamp = strftime "%Y-%m-%d %H:%M:%S", gmtime;
print STDOUT "$timestamp: ".join(' ', @args)."\n";
exec(@args) || die("Failed to exec $args[0]: $!\n");
} else {
waitpid($pid, 0) == $pid || die("Failed on waitpid $pid: $!\n");
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment