Standardize use CL:*LOAD-VERBOSE* to control loading verbosity

Normalize logging output to a Lisp comment prefix (#\;) with a single tag
that identifies the "subsystem" emitting the diagnostic.

CL:*LOAD-VERBOSE* to control them.

be easily modified while keeping in-sync with upstream, but they both
seem to respect setting CL:*LOAD-VERBOSE* to nil to muffle output.

EXT::*WARN-ON-REDEFINITION* signals conditions rather than just
emitting error messages, so it has not been touched as theoretically
some compiler tooling may be somehow be depending on its SIGNAL
behavior.  As such, once an implementation that signals the same
setting should be maintained during a deprecation phase.

# From <>

## Alan Ruttenberg

Really this should just respect load-verbose. If you really want to
fix this properly, do that. There are a proliferation of settings one
has to know about if one wants ABCL to shut up while starting up, and
any beginner will have a hell of a time accomplishing this. There
ought to be a single variable that indicates you don't want these

- *load-verbose*
- system::*verbose*
- asdf::*verbose-out*
- abcl-asdf::*maven-verbose
- quicklisp-client::*quickload-verbose*
- ext::*warn-on-redefinition*

## Mark Evenson

Using CL:LOAD-VERBOSE to unify the control of all this logging
behavior for ABCL is an excellent way forward here.

This wouldn't help with quicklisp-client::quickload-verbose (not our code).

An alternative would be to have some sort of "categorical logging
system" (ala log4j) which would allow one to selectively enable
classes of logging output ("show me all diagnostic from loading
ABCL-CONTRIB"), but a basic boolean predicate here, unified into the
standardized mechanism would go a long ways.


Originated with <>.
parent 20c0fa3b
......@@ -41,9 +41,6 @@ Test:
(defparameter *maven-verbose* t
"Stream to send output from the Maven Aether subsystem to, or NIL to muffle output")
(defparameter *mavens*
(if (find :windows *features*)
'("mvn.bat" "mvn3.bat" "mvn.cmd" "mvn")
......@@ -102,8 +99,8 @@ Emits warnings if not able to find a suitable executable."
which-cmd `(,mvn-path)))))
(end-of-file () nil)
(t (e)
(format *maven-verbose*
"~&Failed to find Maven executable '~A' in PATH because~&~A"
(format cl:*load-verbose*
"~&; abcl-asdf; Failed to find Maven executable '~A' in PATH because~&~A"
mvn-path e)))))
(when mvn
(return-from find-mvn mvn)))))))
......@@ -259,8 +256,8 @@ hint."
(format *maven-verbose*
"~&WagonProvider stub passed '~A' as a hint it couldn't satisfy.~%" role-hint)
(format cl:*load-verbose*
"~&; abcl-asdf; WagonProvider stub passed '~A' as a hint it couldn't satisfy.~%" role-hint)
(lambda (wagon)
......@@ -522,7 +519,7 @@ in Java CLASSPATH representation."
(defun make-repository-listener ()
(flet ((log (e)
(format *maven-verbose* "~&~A~%" (#"toString" e))))
(format cl:*load-verbose* "~&; abcl-asdf; ~A~%" (#"toString" e))))
(#"getName" (jss:find-java-class 'aether.RepositoryListener))
......@@ -23,8 +23,6 @@
......@@ -70,14 +70,9 @@ Used to determine relative pathname to find 'abcl-contrib.jar'."
Initialized via SYSTEM:FIND-CONTRIB.")
(defvar *abcl-contrib-verbose* t
"Stream onto ABCL-CONTRIB reports its activities.
Set to nil to muffle such messages.")
;;; FIXME: stop using the obsolete ASDF:*CENTRAL-REGISTRY*
(defun add-contrib (abcl-contrib-jar
&key (verbose *abcl-contrib-verbose*))
&key (verbose cl:*load-verbose*))
"Introspects the ABCL-CONTRIB-JAR path for sub-directories which
contain asdf definitions, adding those found to asdf."
(let ((jar-path (if (ext:pathname-jar-p abcl-contrib-jar)
......@@ -88,18 +83,18 @@ Set to nil to muffle such messages.")
(let ((asdf-directory (make-pathname :defaults asdf-file :name nil :type nil)))
(unless (find asdf-directory asdf:*central-registry* :test #'equal)
(push asdf-directory asdf:*central-registry*)
(format verbose "~&Added ~A to ASDF.~&" asdf-directory))))))
(format verbose "~&; abcl-contrib; Added ~A to ASDF.~&" asdf-directory))))))
(defun find-and-add-contrib (&key (verbose *abcl-contrib-verbose*))
(defun find-and-add-contrib (&key (verbose cl:*load-verbose*))
"Attempt to find the ABCL contrib jar and add its contents to ASDF.
returns the pathname of the contrib if it can be found."
(if *abcl-contrib*
(format verbose "~&Using already initialized value of abcl-contrib:~&'~A'.~%"
(format verbose "~&; abcl-contrib; Using already initialized value of SYS:*ABCL-CONTRIB* '~A'.~%"
(let ((contrib (find-contrib)))
(when contrib
(format verbose "~&Using probed value of abcl-contrib:~&'~A'.~%"
(format verbose "~&; abcl-contrib; Using probed value of SYS:*ABCL-CONTRIB* '~A'.~%"
(setf *abcl-contrib* contrib)))))
(when *abcl-contrib* ;; For bootstrap compile there will be no contrib
......@@ -172,9 +167,8 @@ returns the pathname of the contrib if it can be found."
(export '(find-system
(when (find-and-add-contrib :verbose *abcl-contrib-verbose*)
(when (find-and-add-contrib :verbose cl:*load-verbose*)
(provide :abcl-contrib))
......@@ -1128,14 +1128,14 @@
(sys::set-function-definition name result definition))
(values (or name result) nil nil)))
(defun precompile-package (pkg &key verbose)
(defun precompile-package (pkg &key (verbose cl:*compile-verbose*))
(dolist (sym (package-symbols pkg))
(when (fboundp sym)
(unless (special-operator-p sym)
(let ((f (fdefinition sym)))
(unless (compiled-function-p f)
(when verbose
(format t "Precompiling ~S~%" sym)
(format t "~&; precompiler; Precompiling ~S~%" sym)
(precompile sym))))))
Markdown is supported
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