mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 08:24:53 +01:00
check global settings on start if logs should be send to mongo
This commit is contained in:
parent
4c495d0aa6
commit
a118c1e980
2 changed files with 13 additions and 0 deletions
|
|
@ -330,6 +330,9 @@ class PypeLogger:
|
||||||
|
|
||||||
# Define if should logging to mongo be used
|
# Define if should logging to mongo be used
|
||||||
use_mongo_logging = bool(log4mongo is not None)
|
use_mongo_logging = bool(log4mongo is not None)
|
||||||
|
if use_mongo_logging:
|
||||||
|
use_mongo_logging = os.environ.get("OPENPYPE_LOG_TO_SERVER") == "1"
|
||||||
|
|
||||||
# Set mongo id for process (ONLY ONCE)
|
# Set mongo id for process (ONLY ONCE)
|
||||||
if use_mongo_logging and cls.mongo_process_id is None:
|
if use_mongo_logging and cls.mongo_process_id is None:
|
||||||
try:
|
try:
|
||||||
|
|
|
||||||
10
start.py
10
start.py
|
|
@ -972,6 +972,16 @@ def boot():
|
||||||
_print(">>> run disk mapping command ...")
|
_print(">>> run disk mapping command ...")
|
||||||
run_disk_mapping_commands(global_settings)
|
run_disk_mapping_commands(global_settings)
|
||||||
|
|
||||||
|
# Logging to server enabled/disabled
|
||||||
|
log_to_server = global_settings.get("log_to_server", True)
|
||||||
|
if log_to_server:
|
||||||
|
os.environ["OPENPYPE_LOG_TO_SERVER"] = "1"
|
||||||
|
log_to_server_msg = "ON"
|
||||||
|
else:
|
||||||
|
os.environ.pop("OPENPYPE_LOG_TO_SERVER", None)
|
||||||
|
log_to_server_msg = "OFF"
|
||||||
|
_print(f">>> Logging to server is turned {log_to_server_msg}")
|
||||||
|
|
||||||
# Get openpype path from database and set it to environment so openpype can
|
# Get openpype path from database and set it to environment so openpype can
|
||||||
# find its versions there and bootstrap them.
|
# find its versions there and bootstrap them.
|
||||||
openpype_path = get_openpype_path_from_settings(global_settings)
|
openpype_path = get_openpype_path_from_settings(global_settings)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue