aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xxmpt22
1 files changed, 16 insertions, 6 deletions
diff --git a/xmpt b/xmpt
index b422e2d..3d7cb3f 100755
--- a/xmpt
+++ b/xmpt
@@ -186,7 +186,7 @@ sub do_send {
# TODO: make write SIGPIPE configurable, but for now just ignore it.
local $SIG{PIPE} = sub {
- print STDERR "Warning: SIGPIPE received from '@ARGV' while writing in $name step.\n"
+ warning("SIGPIPE received from '@ARGV' while writing in $name step.\n");
};
print $evalpkg::out $s;
}
@@ -246,12 +246,22 @@ sub do_recv {
}
}
+sub error {
+ _l("ERROR: " . shift);
+}
+
+sub warning {
+ _l("Warning: " . shift);
+}
+
sub verbose {
- if ($verbose) {
- my $msg = shift;
- chomp $msg;
- print STDERR strftime('%Y-%m-%d %H:%M:%S', localtime) . " [$$] $msg\n";
- }
+ _l(shift) if $verbose;
+}
+
+sub _l {
+ my $msg = shift;
+ chomp $msg;
+ print STDERR strftime('%Y-%m-%d %H:%M:%S', localtime) . " [$$] $msg\n";
}
sub assert_arg {