diff --git a/Log-files.md b/Log-files.md new file mode 100644 index 0000000..60d34fc --- /dev/null +++ b/Log-files.md @@ -0,0 +1,19 @@ +Downloading drawings from a tablet is destructive - the drawings get deleted after a successful download. So we *really* want to make sure we don't screw things up and log as much as possible to recover the data if need be. + +The default directory for all of Tuhi's data storage is `$XDG_DATA_DIR/tuhi`, usually `$HOME/.local/share/tuhi/`. Inside are the various data files Tuhi uses. + +## Raw log files + +Any communication between Tuhi and the device is logged as a YAML file in `$XDG_DATA_DIR/tuhi//raw/`. The files are named after the time they were created, e.g. `log-1565844084-2019-08-15-14:41:24.yaml`, i.e. in the format `log-$UNIX_TIMESTAMP-$HUMAN_READABLE_TIME.yaml`. + +These files contain *one single interaction* with the device, they are created whenever the device connects. Given that it's BLE, the device will disconnect after any check - every few seconds. Most of the files will not have any useful data in it, grep for ``PEN`` to search for files with Pen data. + +The YAML format is not guaranteed to be stable, it is a backup only. The file format is not documented, it's self-descriptive. + +## JSON source files + +Any converted drawing is stored as JSON file in `$XDG_DATA_DIR/tuhi//.json`. These are the files that the Tuhi server will make available over DBus. There is no storage guarantee for those files, they may be deleted at any time. They exist primarily to make testing easier, so we can keep a few files around to verify the server part works as expected. + +## Converted SVG files + +The Tuhi GUI converts JSON files into SVG files. These are stored in `$XDG_DATA_DIR/tuhi/svg/`. Note that because the GUI only handles one device, there is no bluetooth address encoded here. These SVG files are considered cached files only and any interaction with the GUI may regenerate those files. \ No newline at end of file