New util-stdout API.
This commit is contained in:
parent
e42ca1cca5
commit
7a19204242
2 changed files with 13 additions and 2 deletions
|
@ -50,7 +50,7 @@ HACKERBASE-OBJS=hackerbase.o testing.o listing.o cal-month.o \
|
||||||
util-string.o util-io.o util-list.o util-parser.o texts.o \
|
util-string.o util-io.o util-list.o util-parser.o texts.o \
|
||||||
tests.o util-proc.o util-mail.o notifications.o \
|
tests.o util-proc.o util-mail.o notifications.o \
|
||||||
util-format.o brmember-format.o logging.o specification.o \
|
util-format.o brmember-format.o logging.o specification.o \
|
||||||
util-git.o cal-day.o
|
util-git.o cal-day.o util-stdout.o
|
||||||
|
|
||||||
.PHONY: imports
|
.PHONY: imports
|
||||||
imports: $(HACKERBASE-DEPS)
|
imports: $(HACKERBASE-DEPS)
|
||||||
|
@ -372,3 +372,8 @@ CAL-DAY-SOURCES=cal-day.scm util-tag.import.scm cal-month.import.scm \
|
||||||
|
|
||||||
cal-day.o: cal-day.import.scm
|
cal-day.o: cal-day.import.scm
|
||||||
cal-day.import.scm: $(CAL-DAY-SOURCES)
|
cal-day.import.scm: $(CAL-DAY-SOURCES)
|
||||||
|
|
||||||
|
UTIL-STDOUT-SOURCES=util-stdout.scm
|
||||||
|
|
||||||
|
util-stdout.o: util-stdout.import.scm
|
||||||
|
util-stdout.import.scm: $(UTIL-STDOUT-SOURCES)
|
||||||
|
|
|
@ -30,6 +30,7 @@
|
||||||
(
|
(
|
||||||
*stdout-quiet*
|
*stdout-quiet*
|
||||||
stdout-print
|
stdout-print
|
||||||
|
stdout-printf
|
||||||
)
|
)
|
||||||
|
|
||||||
(import scheme
|
(import scheme
|
||||||
|
@ -40,7 +41,12 @@
|
||||||
(define *stdout-quiet* (make-parameter #f))
|
(define *stdout-quiet* (make-parameter #f))
|
||||||
|
|
||||||
;; Prints to stdout if not quiet
|
;; Prints to stdout if not quiet
|
||||||
(define (stdout-print fmt . args)
|
(define (stdout-print . args)
|
||||||
|
(when (not (*stdout-quiet*))
|
||||||
|
(apply print args)))
|
||||||
|
|
||||||
|
;; Prints formatted string to stdout if not quiet
|
||||||
|
(define (stdout-printf fmt . args)
|
||||||
(when (not (*stdout-quiet*))
|
(when (not (*stdout-quiet*))
|
||||||
(print (apply format fmt args))))
|
(print (apply format fmt args))))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue