#lang racket/base
(provide current-verbose-msg?)
(define current-verbose-msg? (make-parameter #f))
(provide msg/port/prefix)
(define (msg/port/prefix port prefix format . args)
(apply fprintf
port
(string-append "raco mcfly: ~A" format "\n")
prefix
args))
(provide msg-info)
(define (msg-info format . args)
(apply msg/port/prefix
(current-output-port)
""
format
args))
(provide msg-warning)
(define (msg-warning format . args)
(apply msg/port/prefix
(current-error-port)
"Warning: "
format
args))
(provide msg-error)
(define (msg-error format . args)
(apply msg/port/prefix
(current-error-port)
"Error: "
format
args))
(provide msg-debug)
(define (msg-debug format . args)
(apply msg/port/prefix
(current-error-port)
"*DEBUG* "
format
args))
(provide msg-verbose)
(define (msg-verbose format . args)
(if (current-verbose-msg?)
(apply msg-info format args)
(void)))
(provide fatal-command-line-error)
(define (fatal-command-line-error format . args)
(apply msg-error format args)
(exit 1))