added optional log level flag