mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-03 09:13:12 +00:00
fix logic judgment error.
This commit is contained in:
@@ -45,7 +45,7 @@ debug_lock = Lock()
|
||||
#TODO: make this a logging callback instead
|
||||
if C.DEFAULT_LOG_PATH:
|
||||
path = C.DEFAULT_LOG_PATH
|
||||
if (os.path.exists(path) and not os.access(path, os.W_OK)) and not os.access(os.path.dirname(path), os.W_OK):
|
||||
if (os.path.exists(path) and not os.access(path, os.W_OK)) or not os.access(os.path.dirname(path), os.W_OK):
|
||||
print("[WARNING]: log file at %s is not writeable, aborting\n" % path, file=sys.stderr)
|
||||
|
||||
logging.basicConfig(filename=path, level=logging.DEBUG, format='%(asctime)s %(name)s %(message)s')
|
||||
|
||||
Reference in New Issue
Block a user