Set logging debug only when -debug flag specified.