fix dir bug and log level default to 1