aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Drew DeVault <sir@cmpwn.com>2017-04-29 10:54:08 -0400
committerLibravatar Drew DeVault <sir@cmpwn.com>2017-04-29 10:54:08 -0400
commit34fae764a5b92d25e5af84431d529d3d46757ff1 (patch)
tree03a8ce3ccbfb73bdbbc708b79a96b441058dc250
parentSet child border to background if not specified (diff)
downloadsway-34fae764a5b92d25e5af84431d529d3d46757ff1.tar.gz
sway-34fae764a5b92d25e5af84431d529d3d46757ff1.tar.zst
sway-34fae764a5b92d25e5af84431d529d3d46757ff1.zip
Add HACKING.md
-rw-r--r--HACKING.md35
1 files changed, 35 insertions, 0 deletions
diff --git a/HACKING.md b/HACKING.md
new file mode 100644
index 00000000..cf18dbb0
--- /dev/null
+++ b/HACKING.md
@@ -0,0 +1,35 @@
1## Logging
2
3Use `sway_log(importance, fmt, ...)` to log. The following importances are
4available:
5
6* `L_DEBUG`: Debug messages, only shows with `sway -d`
7* `L_INFO`: Informational messages
8* `L_ERROR`: Error messages
9
10`sway_log` is a macro that calls `_sway_log` with the current filename and line
11number, which are written into the log with your message.
12
13## Assertions
14
15In the compositor, assertions *must not* be fatal. All error cases must be
16handled as gracefully as possible - crashing the compositor will make the user
17lose all of their work.
18
19Use `sway_assert(condition, fmt, ...)` to perform an assertion. This returns
20`condition`, which you must handle if false. An error will be logged if the
21assertion fails.
22
23Outside of the compositor (swaymsg, swaybar, etc), using `assert.h` is
24permitted.
25
26## Building against a local wlc
27
281. Build wlc as described [here](https://github.com/Cloudef/wlc#building)
292. Inside your sway source folder, tell `cmake` to use your local version of wlc:
30
31```bash
32cmake \
33 -DWLC_LIBRARIES=path/to/wlc/target/src/libwlc.so \
34 -DWLC_INCLUDE_DIRS=path/to/wlc/include .
35```