Use g_debug instead of a custom debug macro

set a log domain accordingly. This make rebuilding for debugging
superfluous.
Adjust format string

Argument is size_t not int