genlogs: make it a lib, add option to only log a specific form