You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Introduce `cider-log-show` function
* Prefer logview-mode unconditionally, and warn when it's absent
This way, users will know logview-mode exists.
There's still fallback, and optionality.
Its usage is mostly self-describing, since each command has its keybinding attached to the description.
47
+
48
+
== Getting started
49
+
50
+
To use CIDER Log Mode, there two main ways to get started:
51
+
52
+
* `M-x cider-log-event`, which uses transient-mode and will not immediately show the logs (you should use transient-mode to show the `+*cider-log*+` buffer)
53
+
* `M-x cider-log-show` 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.
54
+
** It doesn't use transient-mode - it aims to do everything in one step
55
+
** It immediately shows the `+*cider-log*+` buffer
56
+
57
+
NOTE: any of these commands will only succeed in
58
+
a buffer that has a CIDER repl (https://github.com/vspinu/sesman[Sesman]
59
+
session) attached to it.
60
+
61
+
=== Via `cider-log-show`
62
+
63
+
By using `M-x cider-log-show`, all setup and rendering will be performed for you in a single step that doesn't pop up a `transient-mode` menu:
64
+
65
+
* A framework will be set up, automatically
66
+
** You may be prompted for a framework
67
+
** You can prevent the prompt by customizing `cider-log-framework-name` (best done in `dir-locals.el`)
68
+
* A log appender and a log consumer will be setup, automatically
69
+
* The `+*cider-log*+` buffer will be rendered.
70
+
71
+
All these steps are idempotent, so it's safe to run `M-x cider-log-show` more than once.
72
+
73
+
You can refine the setup afterwards (e.g. configuring filtering) by running `M-x cider-log`.
74
+
75
+
=== Via `cider-log-event`
76
+
77
+
The intended workflow for this function is as follows:
78
+
79
+
* Run `M-x cider-log-event`
80
+
* A framework will be set up, automatically
81
+
** You may be prompted for a framework
82
+
** You can prevent the prompt by customizing `cider-log-framework-name` (best done in `dir-locals.el`)
83
+
* A log appender and a log consumer will be setup, automatically
84
+
* The `+*cider-log*+` buffer will _not_ be rendered
85
+
** For it to be rendered, press `s` (`Search log events`) within the transient-mode menu.
86
+
87
+
NOTE: The `+*cider-log*+` buffer might initially be empty, and you may
88
+
see a `No log events found` message. This is because nothing has been
89
+
logged between adding the appender and searching for events. So, now
90
+
would be a good time to run some code that triggers a log event for
91
+
the selected framework.
92
+
93
+
== Advanced usage
94
+
95
+
`cider-log` is a function that can serve both to set up logging from scratch,
96
+
or for tweaking an existing setup (e.g. add filtering to a consumer).
97
+
98
+
It's considered a lower-level approach.
99
+
100
+
=== Setup via `cider-log`
101
+
102
+
Type kbd:[C-c M-l l] or kbd:[M-x cider-log]. The first time you run the command, it will
43
103
prompt you to select a log framework to use, and then attach a log
44
104
appender to the root logger of the selected framework. After the log
45
105
appender has been attached, the `cider-log` command will show a
0 commit comments