Skip to content

Commit 00125ff

Browse files
committed
Update site docs
1 parent 9959d6e commit 00125ff

File tree

6 files changed

+934
-752
lines changed

6 files changed

+934
-752
lines changed
21.5 KB
Loading

docs/cider/config/basic_config.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,7 @@ <h2 id="use-enrich-classpath"><a class="anchor" href="#use-enrich-classpath"></a
502502
<div class="ulist">
503503
<ul>
504504
<li>
505-
<p>For <code>cider-connect</code>, please follow enrich-classpath&#8217;s <a href="https://github.com/clojure-emacs/enrich-classpath/tree/v1.18.6#emacs-cider-connect">own instructions</a>.</p>
505+
<p>For <code>cider-connect</code>, please follow enrich-classpath&#8217;s <a href="https://github.com/clojure-emacs/enrich-classpath/tree/v1.19.0#emacs-cider-connect">own instructions</a>.</p>
506506
</li>
507507
</ul>
508508
</div>

docs/cider/debugging/logging.html

Lines changed: 205 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ <h1 class="page">Logging</h1>
418418
<div class="paragraph">
419419
<p>CIDER Log Mode allows you to capture, debug, inspect and view log
420420
events emitted by Java logging frameworks. The captured log events can
421-
be searched, streamed to the client, pretty printed and are integrated
421+
be searched, streamed to the client, pretty-printed, and are integrated
422422
with the CIDER <a href="inspector.html">Inspector</a> and
423423
<a href="../usage/dealing_with_errors.html">Stacktrace Mode</a>. Here is a
424424
screenshot of CIDER Log Mode in action.</p>
@@ -454,22 +454,22 @@ <h2 id="features"><a class="anchor" href="#features"></a>Features</h2>
454454
<div class="ulist">
455455
<ul>
456456
<li>
457-
<p>Browse Javadocs and website of log framework.</p>
457+
<p>Browse Javadocs and website of the given log framework.</p>
458458
</li>
459459
<li>
460460
<p>Search log events and show them in buffers.</p>
461461
</li>
462462
<li>
463-
<p><a href="../usage/pretty_printing.html">Pretty Print</a> log events.</p>
463+
<p><a href="../usage/pretty_printing.html">Pretty-print</a> log events.</p>
464464
</li>
465465
<li>
466-
<p>Show log events in the CIDER <a href="inspector.html">Inspector</a></p>
466+
<p>Show log events in the CIDER <a href="inspector.html">Inspector</a>.</p>
467467
</li>
468468
<li>
469-
<p>Show log event exceptions in the CIDER <a href="../usage/dealing_with_errors.html">Stacktrace Mode</a></p>
469+
<p>Show log event exceptions in the CIDER <a href="../usage/dealing_with_errors.html">Stacktrace Mode</a>.</p>
470470
</li>
471471
<li>
472-
<p>Integration with <a href="https://github.com/doublep/logview">logview</a></p>
472+
<p>Integration with <a href="https://github.com/doublep/logview">logview</a>.</p>
473473
</li>
474474
</ul>
475475
</div>
@@ -483,30 +483,141 @@ <h2 id="dependencies"><a class="anchor" href="#dependencies"></a>Dependencies</h
483483
of CIDER Log Mode. We recommend using it, since it is responsible for
484484
coloring the log events and it provides other useful features, such as
485485
syntax highlighting, filtering and more. It is used automatically when
486-
available and its use can be customized via <code>cider-log-use-logview</code>.</p>
486+
available, and its use can be customized via <code>cider-log-use-logview</code>.</p>
487487
</div>
488488
</div>
489489
</div>
490490
<div class="sect1">
491-
<h2 id="usage"><a class="anchor" href="#usage"></a>Usage</h2>
491+
<h2 id="transient-mode"><a class="anchor" href="#transient-mode"></a><code>transient-mode</code></h2>
492492
<div class="sectionbody">
493493
<div class="paragraph">
494-
<p>To use CIDER Log Mode, type <kbd>C-c M-l l</kbd> or <kbd>M-x cider-log</kbd> in
495-
any buffer that has a CIDER <a href="https://github.com/vspinu/sesman">Sesman</a>
496-
session attached to it. The first time you run the command, it will
497-
prompt you to select a log framework to use, and then attach a log
498-
appender to the root logger of the selected framework. After the log
499-
appender has been attached, the <code>cider-log</code> command will show a
500-
<a href="https://www.gnu.org/software/emacs/manual/html_mono/transient.html">Transient</a>
501-
menu, from which you can take further actions, like managing the log
502-
framework, appenders, consumers and events.</p>
494+
<p>It&#8217;s worth pointing out that most features and workflows of Cider Log Mode are based on <a href="https://github.com/magit/transient">transient-mode</a>.</p>
503495
</div>
504496
<div class="paragraph">
505-
<p>To view log events and stream them to your client, type <kbd>es</kbd>
506-
(Search log events) followed by <kbd>s</kbd>. This will open the
507-
<code>*cider-log*</code> buffer showing any log events captured thus far. It will
508-
also add a log consumer to this buffer, which receives newly-arriving
509-
log events.</p>
497+
<p>A transient menu is the following widget:</p>
498+
</div>
499+
<div class="imageblock">
500+
<div class="content">
501+
<img src="../_images/cider-log-transient-mode.png" alt="CIDER Log transient menu">
502+
</div>
503+
</div>
504+
<div class="paragraph">
505+
<p>Its usage is mostly self-describing, since each command has its keybinding attached to the description.</p>
506+
</div>
507+
</div>
508+
</div>
509+
<div class="sect1">
510+
<h2 id="getting-started"><a class="anchor" href="#getting-started"></a>Getting started</h2>
511+
<div class="sectionbody">
512+
<div class="paragraph">
513+
<p>To use CIDER Log Mode, there two main ways to get started:</p>
514+
</div>
515+
<div class="ulist">
516+
<ul>
517+
<li>
518+
<p><code>M-x cider-log-event</code>, which uses transient-mode and will not immediately show the logs (you should use transient-mode to show the <code>*cider-log*</code> buffer)</p>
519+
</li>
520+
<li>
521+
<p><code>M-x cider-log-show</code> is a newer function that intends to be an "all-in-one" command, intended for a streamlined experience, which can be useful to get started, or for casual usage.</p>
522+
<div class="ulist">
523+
<ul>
524+
<li>
525+
<p>It doesn&#8217;t use transient-mode - it aims to do everything in one step</p>
526+
</li>
527+
<li>
528+
<p>It immediately shows the <code>*cider-log*</code> buffer</p>
529+
</li>
530+
</ul>
531+
</div>
532+
</li>
533+
</ul>
534+
</div>
535+
<div class="admonitionblock note">
536+
<table>
537+
<tr>
538+
<td class="icon">
539+
<i class="fa icon-note" title="Note"></i>
540+
</td>
541+
<td class="content">
542+
Any of these commands will only succeed in
543+
a buffer that has a CIDER repl (<a href="https://github.com/vspinu/sesman">Sesman</a>
544+
session) attached to it.
545+
</td>
546+
</tr>
547+
</table>
548+
</div>
549+
<div class="sect2">
550+
<h3 id="via-cider-log-show"><a class="anchor" href="#via-cider-log-show"></a>Via <code>cider-log-show</code></h3>
551+
<div class="paragraph">
552+
<p>By using <code>M-x cider-log-show</code>, all setup and rendering will be performed for you in a single step that doesn&#8217;t pop up a <code>transient-mode</code> menu:</p>
553+
</div>
554+
<div class="ulist">
555+
<ul>
556+
<li>
557+
<p>A framework will be set up, automatically</p>
558+
<div class="ulist">
559+
<ul>
560+
<li>
561+
<p>You may be prompted for a framework</p>
562+
</li>
563+
<li>
564+
<p>You can prevent the prompt by customizing <code>cider-log-framework-name</code> (best done in <code>dir-locals.el</code>)</p>
565+
</li>
566+
</ul>
567+
</div>
568+
</li>
569+
<li>
570+
<p>A log appender and a log consumer will be setup, automatically</p>
571+
</li>
572+
<li>
573+
<p>The <code>*cider-log*</code> buffer will be rendered.</p>
574+
</li>
575+
</ul>
576+
</div>
577+
<div class="paragraph">
578+
<p>All these steps are idempotent, so it&#8217;s safe to run <code>M-x cider-log-show</code> more than once.</p>
579+
</div>
580+
<div class="paragraph">
581+
<p>You can refine the setup afterwards (e.g. configuring filtering) by running <code>M-x cider-log</code>, <code>M-x cider-log-consumer</code>, etc.</p>
582+
</div>
583+
</div>
584+
<div class="sect2">
585+
<h3 id="via-cider-log-event"><a class="anchor" href="#via-cider-log-event"></a>Via <code>cider-log-event</code></h3>
586+
<div class="paragraph">
587+
<p>The intended workflow for this function is as follows:</p>
588+
</div>
589+
<div class="ulist">
590+
<ul>
591+
<li>
592+
<p>Run <code>M-x cider-log-event</code></p>
593+
</li>
594+
<li>
595+
<p>A framework will be set up, automatically</p>
596+
<div class="ulist">
597+
<ul>
598+
<li>
599+
<p>You may be prompted for a framework</p>
600+
</li>
601+
<li>
602+
<p>You can prevent the prompt by customizing <code>cider-log-framework-name</code> (best done in <code>dir-locals.el</code>)</p>
603+
</li>
604+
</ul>
605+
</div>
606+
</li>
607+
<li>
608+
<p>A log appender and a log consumer will be setup, automatically</p>
609+
</li>
610+
<li>
611+
<p>The <code>*cider-log*</code> buffer will <em>not</em> be rendered</p>
612+
<div class="ulist">
613+
<ul>
614+
<li>
615+
<p>For it to be rendered, press <code>s</code> (<code>Search log events</code>) within the transient-mode menu.</p>
616+
</li>
617+
</ul>
618+
</div>
619+
</li>
620+
</ul>
510621
</div>
511622
<div class="admonitionblock note">
512623
<table>
@@ -524,6 +635,42 @@ <h2 id="usage"><a class="anchor" href="#usage"></a>Usage</h2>
524635
</tr>
525636
</table>
526637
</div>
638+
</div>
639+
</div>
640+
</div>
641+
<div class="sect1">
642+
<h2 id="advanced-usage"><a class="anchor" href="#advanced-usage"></a>Advanced usage</h2>
643+
<div class="sectionbody">
644+
<div class="paragraph">
645+
<p><code>cider-log</code> is a function that can serve both to set up logging from scratch,
646+
or for tweaking an existing setup (e.g. add filtering to a consumer).</p>
647+
</div>
648+
<div class="paragraph">
649+
<p>It&#8217;s considered a lower-level approach.</p>
650+
</div>
651+
<div class="sect2">
652+
<h3 id="setup-via-cider-log"><a class="anchor" href="#setup-via-cider-log"></a>Setup via <code>cider-log</code></h3>
653+
<div class="paragraph">
654+
<p>Type <kbd>C-c M-l l</kbd> or <kbd>M-x cider-log</kbd>. The first time you run the command, it will
655+
prompt you to select a log framework to use, and then attach a log
656+
appender to the root logger of the selected framework. After the log
657+
appender has been attached, the <code>cider-log</code> command will show a
658+
<a href="https://www.gnu.org/software/emacs/manual/html_mono/transient.html">Transient</a>
659+
menu, from which you can take further actions, like managing the log
660+
framework, appenders, consumers and events.</p>
661+
</div>
662+
<div class="paragraph">
663+
<p>You should add a log appender and a log consumer at this point - else no log entries will be possibly shown
664+
(which is why <code>cider-log</code> is considered a lower-level workflow).</p>
665+
</div>
666+
<div class="paragraph">
667+
<p>After that, to view log events and stream them to your client, type <kbd>es</kbd>
668+
(Search log events) followed by <kbd>s</kbd>. This will open the
669+
<code>*cider-log*</code> buffer showing any log events captured thus far. It will
670+
also add a log consumer to this buffer, which receives newly-arriving
671+
log events.</p>
672+
</div>
673+
</div>
527674
<div class="sect2">
528675
<h3 id="keybindings"><a class="anchor" href="#keybindings"></a>Keybindings</h3>
529676
<table class="tableblock frame-all grid-all stretch">
@@ -532,18 +679,26 @@ <h3 id="keybindings"><a class="anchor" href="#keybindings"></a>Keybindings</h3>
532679
<col style="width: 33.3333%;">
533680
<col style="width: 33.3334%;">
534681
</colgroup>
535-
<thead>
682+
<tbody>
536683
<tr>
537-
<th class="tableblock halign-left valign-top">Command</th>
538-
<th class="tableblock halign-left valign-top">Keyboard shortcut</th>
539-
<th class="tableblock halign-left valign-top">Description</th>
684+
<td class="tableblock halign-left valign-top"><p class="tableblock">Command</p></td>
685+
<td class="tableblock halign-left valign-top"><p class="tableblock">Keyboard shortcut</p></td>
686+
<td class="tableblock halign-left valign-top"><p class="tableblock">Description</p></td>
687+
</tr>
688+
<tr>
689+
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>cider-log-event</code></p></td>
690+
<td class="tableblock halign-left valign-top"><p class="tableblock"><kbd>C-c M-l e</kbd></p></td>
691+
<td class="tableblock halign-left valign-top"><p class="tableblock">Show the menu to manage log events via a transient-mode menu. This is one of the two main entrypoints to get started.</p></td>
692+
</tr>
693+
<tr>
694+
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>cider-log-show</code></p></td>
695+
<td class="tableblock halign-left valign-top"><p class="tableblock"><kbd>C-c M-l s</kbd></p></td>
696+
<td class="tableblock halign-left valign-top"><p class="tableblock">Immediately shows the logs, without a transient-mode menu. This is one of the two main entrypoints to get started.</p></td>
540697
</tr>
541-
</thead>
542-
<tbody>
543698
<tr>
544699
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>cider-log</code></p></td>
545700
<td class="tableblock halign-left valign-top"><p class="tableblock"><kbd>C-c M-l l</kbd></p></td>
546-
<td class="tableblock halign-left valign-top"><p class="tableblock">Show the CIDER log menu.</p></td>
701+
<td class="tableblock halign-left valign-top"><p class="tableblock">Show the CIDER log menu. Please note that this is considered advanced usage.</p></td>
547702
</tr>
548703
<tr>
549704
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>cider-log-framework</code></p></td>
@@ -560,11 +715,6 @@ <h3 id="keybindings"><a class="anchor" href="#keybindings"></a>Keybindings</h3>
560715
<td class="tableblock halign-left valign-top"><p class="tableblock"><kbd>C-c M-l c</kbd></p></td>
561716
<td class="tableblock halign-left valign-top"><p class="tableblock">Show the menu to manage consumers listening to log events.</p></td>
562717
</tr>
563-
<tr>
564-
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>cider-log-event</code></p></td>
565-
<td class="tableblock halign-left valign-top"><p class="tableblock"><kbd>C-c M-l e</kbd></p></td>
566-
<td class="tableblock halign-left valign-top"><p class="tableblock">Show the menu to manage log events.</p></td>
567-
</tr>
568718
</tbody>
569719
</table>
570720
</div>
@@ -575,7 +725,7 @@ <h2 id="log-framework"><a class="anchor" href="#log-framework"></a>Log framework
575725
<div class="sectionbody">
576726
<div class="paragraph">
577727
<p>CIDER Log Mode supports log frameworks that allow reconfiguration at
578-
run time. More specifically the framework should support attaching log
728+
runtime. More specifically the framework should support attaching log
579729
appenders to loggers, in order to capture events.</p>
580730
</div>
581731
<div class="paragraph">
@@ -599,6 +749,26 @@ <h2 id="log-framework"><a class="anchor" href="#log-framework"></a>Log framework
599749
configuration changes made at runtime, which are wiped out by the
600750
Log4j2 reconfiguration mechanism.</p>
601751
</div>
752+
<div class="paragraph">
753+
<p>Timbre support is WIP as well.</p>
754+
</div>
755+
<div class="admonitionblock tip">
756+
<table>
757+
<tr>
758+
<td class="icon">
759+
<i class="fa icon-tip" title="Tip"></i>
760+
</td>
761+
<td class="content">
762+
If your logging framework of choice is not currently supported by CIDER Log Mode,
763+
you can opt to use Clojure&#8217;s official <code>tools.logging</code> façade in your project, such that you can locally,
764+
unobstrusively tell it to use a supported framework (like Logback) instead of your project&#8217;s default one.
765+
Note that its choice of logging backend implementation can be controlled with the
766+
<code>-Dclojure.tools.logging.factory</code> Java system property, which can be cleanly customized locally via Lein profiles,
767+
or Clojure CLI aliases.
768+
</td>
769+
</tr>
770+
</table>
771+
</div>
602772
<div class="sect2">
603773
<h3 id="keybindings-2"><a class="anchor" href="#keybindings-2"></a>Keybindings</h3>
604774
<table class="tableblock frame-all grid-all stretch">

docs/cider/index.html

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -529,6 +529,9 @@ <h2 id="features"><a class="anchor" href="#features"></a>Features</h2>
529529
<p>Definition &amp; documentation lookup</p>
530530
</li>
531531
<li>
532+
<p>Enhanced syntax highlighting and indentation</p>
533+
</li>
534+
<li>
532535
<p>Enhanced error reporting</p>
533536
</li>
534537
<li>
@@ -541,10 +544,19 @@ <h2 id="features"><a class="anchor" href="#features"></a>Features</h2>
541544
<p>Interactive debugger</p>
542545
</li>
543546
<li>
547+
<p>Data Inspector</p>
548+
</li>
549+
<li>
550+
<p>Integration with Java logging frameworks</p>
551+
</li>
552+
<li>
553+
<p>Profiling &amp; tracing</p>
554+
</li>
555+
<li>
544556
<p>ClojureScript support</p>
545557
</li>
546558
<li>
547-
<p>Support for <a href="platforms/overview.html" class="xref page">alternative Clojure platforms</a>(e.g. ClojureCLR, babashka, nbb &amp; lumo)</p>
559+
<p>Support for <a href="platforms/overview.html" class="xref page">alternative Clojure platforms</a> (e.g. ClojureCLR, babashka, nbb &amp; lumo)</p>
548560
</li>
549561
</ul>
550562
</div>

0 commit comments

Comments
 (0)