mirror of
https://github.com/dimitri/pgloader.git
synced 2025-08-11 08:46:59 +02:00
Prevent evaluating unused arguments in log-message.
A stop-gap has been installed to prevent sending too much trafic to the monitor, but the log-message arguments were still evaluated, and the :data level output from format-row-in-batch is pretty costly.
This commit is contained in:
parent
b36f36b74e
commit
a28e9b3556
@ -42,7 +42,13 @@
|
|||||||
(format stream "FATAL: Failed to start the monitor thread.~%")
|
(format stream "FATAL: Failed to start the monitor thread.~%")
|
||||||
(format stream "~%~a~%" (monitor-real-error err)))))
|
(format stream "~%~a~%" (monitor-real-error err)))))
|
||||||
|
|
||||||
(defun log-message (category description &rest arguments)
|
(defmacro log-message (category description &rest arguments)
|
||||||
|
"Protect against evaluating ARGUMENTS in cases where we don't log at the
|
||||||
|
given CATEGORY log-level."
|
||||||
|
`(when (cl-log::category-messengers ,category)
|
||||||
|
(send-log-message ,category ,description ,@arguments)))
|
||||||
|
|
||||||
|
(defun send-log-message (category description &rest arguments)
|
||||||
"Send given message into our monitoring queue for processing."
|
"Send given message into our monitoring queue for processing."
|
||||||
(when (cl-log::category-messengers category)
|
(when (cl-log::category-messengers category)
|
||||||
(send-event (make-log-message :category category
|
(send-event (make-log-message :category category
|
||||||
|
Loading…
Reference in New Issue
Block a user