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.

ABCL-ASDF:*MAVEN-VERBOSE* SYS:*ABCL-CONTRIB-VERBOSE* have been removed; use
CL:*LOAD-VERBOSE* to control them.

ASDF::*VERBOSE-OUT* and QUICKLISP-CLIENT::*QUICKLOAD-VERBOSE* cannot
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
warnings as EXT::*WARN-ON-REDEFINITION* based on CL:*COMPILE-VERBOSE*
setting should be maintained during a deprecation phase.

------------------------------------------------------------------------
# From <https://github.com/armedbear/abcl/commit/6cc94a54cf9256b2a0f13857d4c448d3b5c044fc>

## 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
messages.

- *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 <https://github.com/armedbear/abcl/pull/37>.
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."
(find-http-wagon))
(t
(progn
(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)
java:+null+))))
"release"
(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))))
(java:jinterface-implementation
(#"getName" (jss:find-java-class 'aether.RepositoryListener))
"artifactDeployed"
......
......@@ -23,8 +23,6 @@
#:*maven-http-proxy*
#:make-remote-repository
#:*maven-remote-repository*
#:*maven-verbose*
#:resolve-artifact
#:resolve-dependencies
......
......@@ -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'.~%"
*abcl-contrib*)
(progn
(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'.~%"
contrib)
(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
find-contrib
*abcl-contrib*
*abcl-contrib-verbose*)
*abcl-contrib*)
: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)
(finish-output))
(precompile sym))))))
t)
......
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