Implemented trace-level logging with a flag.