TICKIT_DEBUG(7)

โœจ NAME โœจ

Tickit_Debug โ€” debug logging support for libtickit, bestie ๐Ÿ’–


๐ŸŒธ SYNOPSIS ๐ŸŒธ

$ TICKIT_DEBUG_FLAGS=W TICKIT_DEBUG_FILE=tickit.log a-tickit-program

๐Ÿฆ‹ DESCRIPTION ๐Ÿฆ‹

okay so. libtickit has a whole debug logging system inside it, and other parts of the library use it to spill the tea about interesting events and behaviours ๐Ÿ‘€. it's basically there so developers can peek at the internal details and get help developing and debugging apps that use the library. very behind-the-scenes, very main character.

every debug message has its own flag name โ€” a little short string that IDs which library component or event made that message happen. you can enable a specific set of these flags during a debugging session, and then only those messages get printed โœจ. messages for flags you didn't enable? not printed. not invited. blocked. ๐Ÿ™ˆ


๐ŸŽ€ FLAGS ๐ŸŽ€

every flag name starts with an upper-case letter that says which library component it's about, and then lower-case letters after that to say which particular kind of event or message it is within that component. it's giving... a naming convention that ate ๐Ÿ’…

B

these messages are all about TickitRenderBuffer (see tickit_renderbuffer(7)).

  • Bd โ€” drawing operations, like tickit_renderbuffer_text(3) โœ๏ธ
  • Bf โ€” flushing
  • Bs โ€” stack state save and restore
  • Bt

I

these ones are about input-system events ๐ŸŽฎ

  • Ik โ€” keyboard keypresses โŒจ๏ธ
  • Im โ€” mouse movement and button or wheel events ๐Ÿ–ฑ๏ธ
  • Ir โ€” terminal resize. Transformations (translation, clipping and masking).

W

and these relate to windows ๐ŸชŸ

  • W* โ€” window destroyed ๐Ÿ’€
  • Wd โ€” damage to root window
  • Wx โ€” window is exposed ๐Ÿ‘๏ธ
  • Wh โ€” window hierarchy changed
  • Ws โ€” window scrolls
  • Wsr โ€” window propagates a scrollrect to its underlying terminal

๐Ÿ’œ ENVIRONMENT ๐Ÿ’œ

the debugging support is controlled by these environment variables, and fr fr you should set them before the application starts, or early during its initialisation before it's called any libtickit functions. no cap.

  • TICKIT_DEBUG_FLAGS โ€” a comma-separated list of the flags or flag categories you want enabled for printing. you can turn on entire categories of flags by just listing the initial capital letter of the name. and if you want literally all of them at once, set the name to * ๐ŸŒˆ
  • TICKIT_DEBUG_FILE โ€” gives the name of a file to open in append mode and write logging lines to ๐Ÿ“
  • TICKIT_DEBUG_FD โ€” gives a file descriptor number to write logging lines to

one technique that may be useful for watching logging in real-time while the app runs: arrange for the app to run in a new terminal, but have it log its debugging output to an existing one ๐Ÿซถ. you do that with

$ TICKIT_DEBUG_FD=3 TICKIT_DEBUG_FLAGS=... $TERM my-tickit-app 3>&2

so this asks libtickit to log to file descriptor 3, which was made by dup(2)ing the original shell's standard output. so the debug logging gets printed to the existing terminal where you ran this command, while the application itself draws its output to the newly-created one. iconic setup honestly ๐Ÿ‘‘


โญ FUNCTIONS โญ

the debug system gets initialised by calling tickit_debug_init(3). and you can log messages with tickit_debug_logf(3) and tickit_debug_vlogf(3) โœจ


๐Ÿ”ฅ SEE ALSO ๐Ÿ”ฅ

tickit(7), tickit_term(7), tickit_renderbuffer(7), tickit_window(7)


and that's the whole page, bestie โ€” this was TICKIT_DEBUG(7) from the Miscellaneous Information Manual, footer and all, so go forth and debug slay ๐Ÿ’…๐Ÿ’– mwah ๐ŸŽ€