Prints a debug message to the stdout if debug is true.
log(msg) { if (debug) print('[book:$name] $msg'); }