Jsonrpc: overhaul logging mechanics

* lisp/jsonrpc.el (jsonrpc-connection): Rework.
(initialize-instance :after jsonrpc-connection): New method.
(slot-missing jsonrpc-connection :events-buffer-scrollback-size oset):
New hack.
(jsonrpc-connection-receive): Rework.
(initialize-instance :after jsonrpc-process-connection): Rework
from non-after version.
(jsonrpc-connection-send)
(jsonrpc--call-deferred)
(jsonrpc--process-sentinel)
(jsonrpc--async-request-1, jsonrpc--debug, jsonrpc--log-event)
(jsonrpc--forwarding-buffer): Rework.
(jsonrpc--run-event-hook): New helper.
(jsonrpc-event-hook): New hook.

* lisp/progmodes/eglot.el (eglot-lsp-server): Fix project slot
initform.
(eglot--connect): Use new jsonrpc-connection initarg.

* test/lisp/progmodes/eglot-tests.el (eglot--sniffing): Use
jsonrpc-event-hook.
(eglot-test-basic-completions): Fix test.
1 job for master in 1 minute and 58 seconds (queued for 28 seconds)
Status Job ID Name Coverage
  Normal
failed #78751
test-lisp-inotify

00:01:58

 
Name Stage Failure
failed
test-lisp-inotify Normal
$ find ${test_name} ! \( -name "*.log" -o -name ${EMACS_TEST_JUNIT_REPORT} \) -type f -delete
find: test-lisp-inotify-e0b9944b: No such file or directory
Uploading artifacts...
WARNING: test-lisp-inotify-e0b9944b/: no matching files
ERROR: No files to upload
Uploading artifacts...
WARNING: test-lisp-inotify-e0b9944b/junit-test-report.xml: no matching files
ERROR: No files to upload
ERROR: Job failed: exit code 1