added getLogs function and cli switch