Skip to content

Commit ac30633

Browse files
committed
Add a summary of various debugging features in Eldev.
1 parent 0dcbed2 commit ac30633

File tree

1 file changed

+61
-3
lines changed

1 file changed

+61
-3
lines changed

README.adoc

Lines changed: 61 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ endif::[]
4646
:since-0-4: image:https://img.shields.io/badge/since-0.4-8be[Since 0.4,float=right]
4747
:since-0-5: image:https://img.shields.io/badge/since-0.5-8be[Since 0.5,float=right]
4848
:since-0-6: image:https://img.shields.io/badge/since-0.6-8be[Since 0.6,float=right]
49+
:since-0-7: image:https://img.shields.io/badge/since-0.7-8be[Since 0.7,float=right]
4950
:since-0-8: image:https://img.shields.io/badge/since-0.8-8be[Since 0.8,float=right]
5051

5152
= Eldev
@@ -298,7 +299,8 @@ Two most important global options to remember are `--trace` (`-t`) and
298299
information about what it is doing to stdout. With the second, Eldev
299300
prints stacktraces for most errors. These options will often help you
300301
figure out what’s going wrong without requesting any external
301-
assistance.
302+
assistance. Also check out section on <<debugging-features,various
303+
debugging features>> discussed later.
302304

303305
Eldev mostly follows GNU conventions in its command line. Perhaps the
304306
only exception is that global options must be specified before command
@@ -1120,8 +1122,10 @@ When a test is failing, a backtrace of the failure is printed. You
11201122
can affect its readability and completeness using options `-b`
11211123
(`--print-backtrace`, the default) and `-B` (`--omit-backtraces`).
11221124
The first option accepts your screen width as an optional parameter;
1123-
backtrace lines get cut to the specified width. Special value of 0
1124-
(the default in Eldev) disables truncation of backtrace lines. Second
1125+
backtrace lines get cut to the specified width. (Since 0.7 this can
1126+
also be specified as a global option that additionally affects all
1127+
other backtraces that are printed by Eldev.) Special value of 0 (the
1128+
default in Eldev) disables truncation of backtrace lines. Second
11251129
option, `-B`, is surprisingly useful. In many cases backtraces don’t
11261130
actually give any useful information, especially when the tests
11271131
contain only a single assertion, and only clutter the output. If you
@@ -1648,6 +1652,60 @@ your source warning-free today, it might detect problems tomorrow.
16481652
$ eldev -dtT lint re
16491653

16501654

1655+
[#debugging-features]
1656+
== Debugging features
1657+
1658+
Eldev comes with lots of different options and other features that can
1659+
help you debug problems both in your project, Eldev itself or your
1660+
Eldev scripts.
1661+
1662+
* Global options `-t` (`--trace`), `-v` (`--verbose`) and `-q`
1663+
(`--quiet`) control the amount of output Eldev generates. The first
1664+
one makes Eldev extra verbose, helping you to understand what it is
1665+
doing and at which step something goes wrong.
1666+
1667+
* Global option `-d` (`--debug`) makes Eldev print backtrace if it
1668+
dies with a Elisp signal (except certain well-defined and explained
1669+
errors like missing dependency).
1670+
1671+
* {since-0-3} Global option `-Q` (`--backtrace-on-abort`) makes Eldev
1672+
print backtrace if it is aborted with `^C`. This is useful if your
1673+
project freezes or has very bad performance, and you want to figure
1674+
where exactly this happens.
1675+
1676+
* {since-0-7} Global option `-b` (`--backtrace`) lets you adapt
1677+
backtraces to your screen width and thus make them more readable at
1678+
the expense of completeness (by default, Eldev doesn’t truncate
1679+
backtrace lines). It is a good idea to change the default in file
1680+
`.eldev/config`.
1681+
1682+
* Global option `-T` (`--time`) prepends timestamps to all lines of
1683+
Eldev output, making it easier to spot performance problems.
1684+
1685+
* Command `prepare` can be used to install all project dependencies —
1686+
and thus check if they and package archives are specified correctly
1687+
— without doing anything else.
1688+
1689+
* Commands `deps` (`dependencies`) and `dtree` (`dependency-tree`) can
1690+
be used to display list or tree of project dependencies, which is
1691+
especially useful for large projects unfamiliar to you.
1692+
1693+
* For many errors, Eldev will print additional hints (unless you
1694+
specify option `--quiet`). For example: if an error happens during
1695+
evaluating file `Eldev`, the tool will mention this; if a dependency
1696+
cannot be installed, Eldev will mention what required this
1697+
dependency (can be non-obvious in larger packages).
1698+
1699+
* While not a direct feature of Eldev itself, file `Eldev-local`
1700+
provides a good place to install temporary advices, overwrite Emacs
1701+
functions etc. in the process of debugging certain problems.
1702+
1703+
* You can temporarily add calls to `eldev-warn`, `eldev-backtrace` and
1704+
other Eldev functions to the tests in your project to provide
1705+
additional output. But it is a good idea to do this only while
1706+
debugging and avoid committing such changes.
1707+
1708+
16511709
== Plugins
16521710

16531711
{since-0-3} Plugins are activatable extensions to Eldev functionality.

0 commit comments

Comments
 (0)