Fix the level compare logic; Add debug helper function to the log package. To keep it simple, I didn't add a sync lock while changing the logFlags. Your review will be appreciated.