diff options
| author | Furkan Sahin <furkan-dev@proton.me> | 2017-06-14 18:53:40 -0400 |
|---|---|---|
| committer | Furkan Sahin <furkan-dev@proton.me> | 2017-06-14 18:53:40 -0400 |
| commit | 38126776c5ab5f5c9f49024418f52a7cc536bc1a (patch) | |
| tree | dcb3b74f1dde93bce8657b7509662ffd7db667d0 /HACKING.md | |
| parent | 482b1e79a864b898f5c3e084c4c1ebfc2dcf2b30 (diff) | |
| parent | 486dd9d8df42780e6a604403d854af6d6600ca39 (diff) | |
Merge branch 'master' into server-decoration
Diffstat (limited to 'HACKING.md')
| -rw-r--r-- | HACKING.md | 35 |
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 @@ +## Logging + +Use `sway_log(importance, fmt, ...)` to log. The following importances are +available: + +* `L_DEBUG`: Debug messages, only shows with `sway -d` +* `L_INFO`: Informational messages +* `L_ERROR`: Error messages + +`sway_log` is a macro that calls `_sway_log` with the current filename and line +number, which are written into the log with your message. + +## Assertions + +In the compositor, assertions *must not* be fatal. All error cases must be +handled as gracefully as possible - crashing the compositor will make the user +lose all of their work. + +Use `sway_assert(condition, fmt, ...)` to perform an assertion. This returns +`condition`, which you must handle if false. An error will be logged if the +assertion fails. + +Outside of the compositor (swaymsg, swaybar, etc), using `assert.h` is +permitted. + +## Building against a local wlc + +1. Build wlc as described [here](https://github.com/Cloudef/wlc#building) +2. Inside your sway source folder, tell `cmake` to use your local version of wlc: + +```bash +cmake \ + -DWLC_LIBRARIES=path/to/wlc/target/src/libwlc.so \ + -DWLC_INCLUDE_DIRS=path/to/wlc/include . +``` |
