aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMattia Rizzolo <mattia@mapreri.org>2015-11-13 11:21:45 +0000
committerMattia Rizzolo <mattia@mapreri.org>2015-11-15 10:16:16 +0000
commit142b718d9bce0be499e8426c27bce848728559a8 (patch)
treebd0ba4e9749b3f2b18bf4858cf276eb705cf6dbc
parent311c138dc394e6771517f339f234afff80ab54f6 (diff)
downloadpbuilder-142b718d9bce0be499e8426c27bce848728559a8.tar
pbuilder-142b718d9bce0be499e8426c27bce848728559a8.tar.gz
modules: add 3 log.{i,w,e} functions to be used instead of log()
-rw-r--r--pbuilder-modules12
-rwxr-xr-xt/test_pbuilder-modules9
2 files changed, 21 insertions, 0 deletions
diff --git a/pbuilder-modules b/pbuilder-modules
index 363f7d7..806f6f0 100644
--- a/pbuilder-modules
+++ b/pbuilder-modules
@@ -116,6 +116,18 @@ function log() {
esac
}
+log.e() {
+ log "E: $*"
+}
+
+log.w() {
+ log "W: $*"
+}
+
+log.i() {
+ log "I: $*"
+}
+
# test whether a directory is empty
# fails if "$*" exists but isn't a directory
# fails and outputs garbage if "$*" doesn't actually exist
diff --git a/t/test_pbuilder-modules b/t/test_pbuilder-modules
index 9e1f6e0..52a38ac 100755
--- a/t/test_pbuilder-modules
+++ b/t/test_pbuilder-modules
@@ -18,6 +18,15 @@ expect_output "I: test
W: warning
E: error" test_information
+function test_log() {
+ log.i "info"
+ log.w "warn"
+ log.e "error"
+}
+expect_output "I: info
+W: warn
+E: error" test_log
+
# test the non-copy case
function test_conditional_cp_a() {
(