From e8954219ae3916ffd47ce798fb9d703658f404dd Mon Sep 17 00:00:00 2001 From: Jakub Trllo Date: Wed, 7 Feb 2024 16:24:49 +0100 Subject: [PATCH] use 'AYON_LOG_NO_COLORS' and 'AYON_DEBUG' --- client/ayon_core/hosts/aftereffects/addon.py | 2 +- .../ayon_core/hosts/aftereffects/api/extension/js/main.js | 2 +- client/ayon_core/hosts/aftereffects/api/launch_logic.py | 2 +- client/ayon_core/hosts/fusion/addon.py | 2 +- client/ayon_core/hosts/harmony/api/lib.py | 2 +- client/ayon_core/hosts/maya/addon.py | 2 +- client/ayon_core/hosts/photoshop/addon.py | 2 +- client/ayon_core/hosts/photoshop/api/lib.py | 2 +- client/ayon_core/hosts/resolve/hooks/pre_resolve_setup.py | 4 ++-- client/ayon_core/hosts/substancepainter/addon.py | 2 +- client/ayon_core/hosts/tvpaint/addon.py | 2 +- client/ayon_core/hosts/unreal/addon.py | 2 +- client/ayon_core/lib/log.py | 8 ++++---- client/ayon_core/lib/terminal.py | 8 ++++---- .../plugins/publish/submit_aftereffects_deadline.py | 2 +- .../deadline/plugins/publish/submit_blender_deadline.py | 2 +- .../deadline/plugins/publish/submit_fusion_deadline.py | 2 +- .../deadline/plugins/publish/submit_harmony_deadline.py | 2 +- .../plugins/publish/submit_houdini_cache_deadline.py | 2 +- .../plugins/publish/submit_houdini_render_deadline.py | 2 +- .../deadline/plugins/publish/submit_max_deadline.py | 2 +- .../deadline/plugins/publish/submit_maya_deadline.py | 2 +- .../publish/submit_maya_remote_publish_deadline.py | 2 +- .../deadline/plugins/publish/submit_publish_cache_job.py | 2 +- .../deadline/plugins/publish/submit_publish_job.py | 2 +- 25 files changed, 32 insertions(+), 32 deletions(-) diff --git a/client/ayon_core/hosts/aftereffects/addon.py b/client/ayon_core/hosts/aftereffects/addon.py index 2a5da8b3a8..278f836a72 100644 --- a/client/ayon_core/hosts/aftereffects/addon.py +++ b/client/ayon_core/hosts/aftereffects/addon.py @@ -11,7 +11,7 @@ class AfterEffectsAddon(OpenPypeModule, IHostAddon): def add_implementation_envs(self, env, _app): """Modify environments to contain all required for implementation.""" defaults = { - "OPENPYPE_LOG_NO_COLORS": "True", + "AYON_LOG_NO_COLORS": "1", "WEBSOCKET_URL": "ws://localhost:8097/ws/" } for key, value in defaults.items(): diff --git a/client/ayon_core/hosts/aftereffects/api/extension/js/main.js b/client/ayon_core/hosts/aftereffects/api/extension/js/main.js index 643671b3e1..a9f91e436f 100644 --- a/client/ayon_core/hosts/aftereffects/api/extension/js/main.js +++ b/client/ayon_core/hosts/aftereffects/api/extension/js/main.js @@ -17,7 +17,7 @@ async function startUp(url){ var res = await promis; log.warn("res: " + res); - promis = runEvalScript("getEnv('OPENPYPE_DEBUG')"); + promis = runEvalScript("getEnv('AYON_DEBUG')"); var debug = await promis; log.warn("debug: " + debug); if (debug && debug.toString() == '3'){ diff --git a/client/ayon_core/hosts/aftereffects/api/launch_logic.py b/client/ayon_core/hosts/aftereffects/api/launch_logic.py index d8516f002f..ad521c2f01 100644 --- a/client/ayon_core/hosts/aftereffects/api/launch_logic.py +++ b/client/ayon_core/hosts/aftereffects/api/launch_logic.py @@ -42,7 +42,7 @@ def main(*subprocess_args): host = AfterEffectsHost() install_host(host) - os.environ["OPENPYPE_LOG_NO_COLORS"] = "False" + os.environ["AYON_LOG_NO_COLORS"] = "0" app = get_ayon_qt_app() app.setQuitOnLastWindowClosed(False) diff --git a/client/ayon_core/hosts/fusion/addon.py b/client/ayon_core/hosts/fusion/addon.py index 67ff5fbe6b..7eff2d93c8 100644 --- a/client/ayon_core/hosts/fusion/addon.py +++ b/client/ayon_core/hosts/fusion/addon.py @@ -63,7 +63,7 @@ class FusionAddon(OpenPypeModule, IHostAddon): def add_implementation_envs(self, env, app): # Set default values if are not already set via settings - defaults = {"OPENPYPE_LOG_NO_COLORS": "Yes"} + defaults = {"AYON_LOG_NO_COLORS": "1"} for key, value in defaults.items(): if not env.get(key): env[key] = value diff --git a/client/ayon_core/hosts/harmony/api/lib.py b/client/ayon_core/hosts/harmony/api/lib.py index 33fe26e558..782134c343 100644 --- a/client/ayon_core/hosts/harmony/api/lib.py +++ b/client/ayon_core/hosts/harmony/api/lib.py @@ -81,7 +81,7 @@ class _ZipFile(zipfile.ZipFile): def main(*subprocess_args): # coloring in StdOutBroker - os.environ["OPENPYPE_LOG_NO_COLORS"] = "False" + os.environ["AYON_LOG_NO_COLORS"] = "0" app = QtWidgets.QApplication([]) app.setQuitOnLastWindowClosed(False) icon = QtGui.QIcon(style.get_app_icon_path()) diff --git a/client/ayon_core/hosts/maya/addon.py b/client/ayon_core/hosts/maya/addon.py index c411f79d6e..745850f6a8 100644 --- a/client/ayon_core/hosts/maya/addon.py +++ b/client/ayon_core/hosts/maya/addon.py @@ -29,7 +29,7 @@ class MayaAddon(OpenPypeModule, IHostAddon): # Set default environments envs = { - "OPENPYPE_LOG_NO_COLORS": "Yes", + "AYON_LOG_NO_COLORS": "1", # For python module 'qtpy' "QT_API": "PySide2", # For python module 'Qt' diff --git a/client/ayon_core/hosts/photoshop/addon.py b/client/ayon_core/hosts/photoshop/addon.py index aa61c08b32..0c7efdb317 100644 --- a/client/ayon_core/hosts/photoshop/addon.py +++ b/client/ayon_core/hosts/photoshop/addon.py @@ -14,7 +14,7 @@ class PhotoshopAddon(OpenPypeModule, IHostAddon): def add_implementation_envs(self, env, _app): """Modify environments to contain all required for implementation.""" defaults = { - "OPENPYPE_LOG_NO_COLORS": "True", + "AYON_LOG_NO_COLORS": "1", "WEBSOCKET_URL": "ws://localhost:8099/ws/" } for key, value in defaults.items(): diff --git a/client/ayon_core/hosts/photoshop/api/lib.py b/client/ayon_core/hosts/photoshop/api/lib.py index 8a11bfee8f..3111503e40 100644 --- a/client/ayon_core/hosts/photoshop/api/lib.py +++ b/client/ayon_core/hosts/photoshop/api/lib.py @@ -28,7 +28,7 @@ def main(*subprocess_args): sys.excepthook = safe_excepthook # coloring in StdOutBroker - os.environ["OPENPYPE_LOG_NO_COLORS"] = "False" + os.environ["AYON_LOG_NO_COLORS"] = "0" app = get_ayon_qt_app() app.setQuitOnLastWindowClosed(False) diff --git a/client/ayon_core/hosts/resolve/hooks/pre_resolve_setup.py b/client/ayon_core/hosts/resolve/hooks/pre_resolve_setup.py index be8ccaa5c5..c14fd75b2f 100644 --- a/client/ayon_core/hosts/resolve/hooks/pre_resolve_setup.py +++ b/client/ayon_core/hosts/resolve/hooks/pre_resolve_setup.py @@ -25,7 +25,7 @@ class PreLaunchResolveSetup(PreLaunchHook): It also defines: - `RESOLVE_UTILITY_SCRIPTS_DIR`: Destination directory for OpenPype Fusion scripts to be copied to for Resolve to pick them up. - - `OPENPYPE_LOG_NO_COLORS` to True to ensure OP doesn't try to + - `AYON_LOG_NO_COLORS` to True to ensure OP doesn't try to use logging with terminal colors as it fails in Resolve. """ @@ -132,7 +132,7 @@ class PreLaunchResolveSetup(PreLaunchHook): ] = resolve_utility_scripts_dir.as_posix() # remove terminal coloring tags - self.launch_context.env["OPENPYPE_LOG_NO_COLORS"] = "True" + self.launch_context.env["AYON_LOG_NO_COLORS"] = "1" # Resolve Setup integration setup(self.launch_context.env) diff --git a/client/ayon_core/hosts/substancepainter/addon.py b/client/ayon_core/hosts/substancepainter/addon.py index 7fbe93aa21..a7f21c2288 100644 --- a/client/ayon_core/hosts/substancepainter/addon.py +++ b/client/ayon_core/hosts/substancepainter/addon.py @@ -21,7 +21,7 @@ class SubstanceAddon(OpenPypeModule, IHostAddon): env["SUBSTANCE_PAINTER_PLUGINS_PATH"] = plugin_path # Log in Substance Painter doesn't support custom terminal colors - env["OPENPYPE_LOG_NO_COLORS"] = "Yes" + env["AYON_LOG_NO_COLORS"] = "1" def get_launch_hook_paths(self, app): if app.host_name != self.host_name: diff --git a/client/ayon_core/hosts/tvpaint/addon.py b/client/ayon_core/hosts/tvpaint/addon.py index d9f3b219ab..375f7266ae 100644 --- a/client/ayon_core/hosts/tvpaint/addon.py +++ b/client/ayon_core/hosts/tvpaint/addon.py @@ -23,7 +23,7 @@ class TVPaintAddon(OpenPypeModule, IHostAddon): """Modify environments to contain all required for implementation.""" defaults = { - "OPENPYPE_LOG_NO_COLORS": "True" + "AYON_LOG_NO_COLORS": "1" } for key, value in defaults.items(): if not env.get(key): diff --git a/client/ayon_core/hosts/unreal/addon.py b/client/ayon_core/hosts/unreal/addon.py index 3cc695ba99..888246bd97 100644 --- a/client/ayon_core/hosts/unreal/addon.py +++ b/client/ayon_core/hosts/unreal/addon.py @@ -59,7 +59,7 @@ class UnrealAddon(OpenPypeModule, IHostAddon): # Set default environments if are not set via settings defaults = { - "OPENPYPE_LOG_NO_COLORS": "True", + "AYON_LOG_NO_COLORS": "1", "UE_PYTHONPATH": os.environ.get("PYTHONPATH", ""), } for key, value in defaults.items(): diff --git a/client/ayon_core/lib/log.py b/client/ayon_core/lib/log.py index b6fd77021c..cbb1e41bae 100644 --- a/client/ayon_core/lib/log.py +++ b/client/ayon_core/lib/log.py @@ -134,7 +134,7 @@ class Logger: initialized = False _init_lock = threading.Lock() - # Logging level - OPENPYPE_LOG_LEVEL + # Logging level - AYON_LOG_LEVEL log_level = None # Data same for all record documents @@ -194,10 +194,10 @@ class Logger: cls.initialized = False # Define what is logging level - log_level = os.getenv("OPENPYPE_LOG_LEVEL") + log_level = os.getenv("AYON_LOG_LEVEL") if not log_level: - # Check OPENPYPE_DEBUG for backwards compatibility - op_debug = os.getenv("OPENPYPE_DEBUG") + # Check AYON_DEBUG for debug level + op_debug = os.getenv("AYON_DEBUG") if op_debug and int(op_debug) > 0: log_level = 10 else: diff --git a/client/ayon_core/lib/terminal.py b/client/ayon_core/lib/terminal.py index 29537234e8..f822a37286 100644 --- a/client/ayon_core/lib/terminal.py +++ b/client/ayon_core/lib/terminal.py @@ -21,7 +21,7 @@ class Terminal: If :mod:`Colorama` is not found, it will still work, but without colors. Depends on :mod:`Colorama` - Using **OPENPYPE_LOG_NO_COLORS** environment variable. + Using **AYON_LOG_NO_COLORS** environment variable. """ # Is Terminal initialized @@ -38,7 +38,7 @@ class Terminal: """Initialize Terminal class as object. First check if colorized output is disabled by environment variable - `OPENPYPE_LOG_NO_COLORS` value. By default is colorized output turned + `AYON_LOG_NO_COLORS` value. By default is colorized output turned on. Then tries to import python module that do the colors magic and create @@ -50,7 +50,7 @@ class Terminal: from ayon_core.lib import env_value_to_bool log_no_colors = env_value_to_bool( - "OPENPYPE_LOG_NO_COLORS", default=None + "AYON_LOG_NO_COLORS", default=None ) if log_no_colors is not None: Terminal.use_colors = not log_no_colors @@ -169,7 +169,7 @@ class Terminal: def log(message): """Return color formatted message. - If environment variable `OPENPYPE_LOG_NO_COLORS` is set to + If environment variable `AYON_LOG_NO_COLORS` is set to whatever value, message will be formatted but not colorized. Args: diff --git a/client/ayon_core/modules/deadline/plugins/publish/submit_aftereffects_deadline.py b/client/ayon_core/modules/deadline/plugins/publish/submit_aftereffects_deadline.py index af8978c43d..2db585f772 100644 --- a/client/ayon_core/modules/deadline/plugins/publish/submit_aftereffects_deadline.py +++ b/client/ayon_core/modules/deadline/plugins/publish/submit_aftereffects_deadline.py @@ -86,7 +86,7 @@ class AfterEffectsSubmitDeadline( "AVALON_TASK", "AVALON_APP_NAME", "OPENPYPE_DEV", - "OPENPYPE_LOG_NO_COLORS", + "AYON_LOG_NO_COLORS", "IS_TEST" ] diff --git a/client/ayon_core/modules/deadline/plugins/publish/submit_blender_deadline.py b/client/ayon_core/modules/deadline/plugins/publish/submit_blender_deadline.py index cdc19e87a0..ddd2b7cdf8 100644 --- a/client/ayon_core/modules/deadline/plugins/publish/submit_blender_deadline.py +++ b/client/ayon_core/modules/deadline/plugins/publish/submit_blender_deadline.py @@ -122,7 +122,7 @@ class BlenderSubmitDeadline(abstract_submit_deadline.AbstractSubmitDeadline, # to recognize job from PYPE for turning Event On/Off job_info.add_render_job_env_var() - job_info.EnvironmentKeyValue["OPENPYPE_LOG_NO_COLORS"] = "1" + job_info.EnvironmentKeyValue["AYON_LOG_NO_COLORS"] = "1" # Adding file dependencies. if self.asset_dependencies: diff --git a/client/ayon_core/modules/deadline/plugins/publish/submit_fusion_deadline.py b/client/ayon_core/modules/deadline/plugins/publish/submit_fusion_deadline.py index a5f590188e..f62c050704 100644 --- a/client/ayon_core/modules/deadline/plugins/publish/submit_fusion_deadline.py +++ b/client/ayon_core/modules/deadline/plugins/publish/submit_fusion_deadline.py @@ -226,7 +226,7 @@ class FusionSubmitDeadline( "AVALON_TASK", "AVALON_APP_NAME", "OPENPYPE_DEV", - "OPENPYPE_LOG_NO_COLORS", + "AYON_LOG_NO_COLORS", "IS_TEST", "AYON_BUNDLE_NAME", ] diff --git a/client/ayon_core/modules/deadline/plugins/publish/submit_harmony_deadline.py b/client/ayon_core/modules/deadline/plugins/publish/submit_harmony_deadline.py index 5941b872a4..a1498add42 100644 --- a/client/ayon_core/modules/deadline/plugins/publish/submit_harmony_deadline.py +++ b/client/ayon_core/modules/deadline/plugins/publish/submit_harmony_deadline.py @@ -279,7 +279,7 @@ class HarmonySubmitDeadline( "AVALON_TASK", "AVALON_APP_NAME", "OPENPYPE_DEV", - "OPENPYPE_LOG_NO_COLORS" + "AYON_LOG_NO_COLORS" "IS_TEST" ] diff --git a/client/ayon_core/modules/deadline/plugins/publish/submit_houdini_cache_deadline.py b/client/ayon_core/modules/deadline/plugins/publish/submit_houdini_cache_deadline.py index 553e2e58c9..c6514d088e 100644 --- a/client/ayon_core/modules/deadline/plugins/publish/submit_houdini_cache_deadline.py +++ b/client/ayon_core/modules/deadline/plugins/publish/submit_houdini_cache_deadline.py @@ -104,7 +104,7 @@ class HoudiniCacheSubmitDeadline(abstract_submit_deadline.AbstractSubmitDeadline "AVALON_TASK", "AVALON_APP_NAME", "OPENPYPE_DEV", - "OPENPYPE_LOG_NO_COLORS", + "AYON_LOG_NO_COLORS", ] environment = dict({key: os.environ[key] for key in keys diff --git a/client/ayon_core/modules/deadline/plugins/publish/submit_houdini_render_deadline.py b/client/ayon_core/modules/deadline/plugins/publish/submit_houdini_render_deadline.py index 79ab96aa50..0d33534ecb 100644 --- a/client/ayon_core/modules/deadline/plugins/publish/submit_houdini_render_deadline.py +++ b/client/ayon_core/modules/deadline/plugins/publish/submit_houdini_render_deadline.py @@ -209,7 +209,7 @@ class HoudiniSubmitDeadline( "AVALON_TASK", "AVALON_APP_NAME", "OPENPYPE_DEV", - "OPENPYPE_LOG_NO_COLORS", + "AYON_LOG_NO_COLORS", ] environment = dict({key: os.environ[key] for key in keys diff --git a/client/ayon_core/modules/deadline/plugins/publish/submit_max_deadline.py b/client/ayon_core/modules/deadline/plugins/publish/submit_max_deadline.py index caf56db967..87637fc433 100644 --- a/client/ayon_core/modules/deadline/plugins/publish/submit_max_deadline.py +++ b/client/ayon_core/modules/deadline/plugins/publish/submit_max_deadline.py @@ -126,7 +126,7 @@ class MaxSubmitDeadline(abstract_submit_deadline.AbstractSubmitDeadline, # to recognize render jobs job_info.add_render_job_env_var() - job_info.EnvironmentKeyValue["OPENPYPE_LOG_NO_COLORS"] = "1" + job_info.EnvironmentKeyValue["AYON_LOG_NO_COLORS"] = "1" # Add list of expected files to job # --------------------------------- diff --git a/client/ayon_core/modules/deadline/plugins/publish/submit_maya_deadline.py b/client/ayon_core/modules/deadline/plugins/publish/submit_maya_deadline.py index 1651f377d2..9f83d271f7 100644 --- a/client/ayon_core/modules/deadline/plugins/publish/submit_maya_deadline.py +++ b/client/ayon_core/modules/deadline/plugins/publish/submit_maya_deadline.py @@ -219,7 +219,7 @@ class MayaSubmitDeadline(abstract_submit_deadline.AbstractSubmitDeadline, # to recognize render jobs job_info.add_render_job_env_var() - job_info.EnvironmentKeyValue["OPENPYPE_LOG_NO_COLORS"] = "1" + job_info.EnvironmentKeyValue["AYON_LOG_NO_COLORS"] = "1" # Adding file dependencies. if not bool(os.environ.get("IS_TEST")) and self.asset_dependencies: diff --git a/client/ayon_core/modules/deadline/plugins/publish/submit_maya_remote_publish_deadline.py b/client/ayon_core/modules/deadline/plugins/publish/submit_maya_remote_publish_deadline.py index ab78efa196..2b497d0626 100644 --- a/client/ayon_core/modules/deadline/plugins/publish/submit_maya_remote_publish_deadline.py +++ b/client/ayon_core/modules/deadline/plugins/publish/submit_maya_remote_publish_deadline.py @@ -106,10 +106,10 @@ class MayaSubmitRemotePublishDeadline( environment["AVALON_ASSET"] = instance.context.data["asset"] environment["AVALON_TASK"] = instance.context.data["task"] environment["AVALON_APP_NAME"] = os.environ.get("AVALON_APP_NAME") - environment["OPENPYPE_LOG_NO_COLORS"] = "1" environment["OPENPYPE_USERNAME"] = instance.context.data["user"] environment["OPENPYPE_PUBLISH_SUBSET"] = instance.data["subset"] environment["OPENPYPE_REMOTE_PUBLISH"] = "1" + environment["AYON_LOG_NO_COLORS"] = "1" environment["AYON_REMOTE_PUBLISH"] = "1" for key, value in environment.items(): diff --git a/client/ayon_core/modules/deadline/plugins/publish/submit_publish_cache_job.py b/client/ayon_core/modules/deadline/plugins/publish/submit_publish_cache_job.py index cb0251402d..83740b3ff3 100644 --- a/client/ayon_core/modules/deadline/plugins/publish/submit_publish_cache_job.py +++ b/client/ayon_core/modules/deadline/plugins/publish/submit_publish_cache_job.py @@ -134,7 +134,7 @@ class ProcessSubmittedCacheJobOnFarm(pyblish.api.InstancePlugin, "AVALON_ASSET": instance.context.data["asset"], "AVALON_TASK": instance.context.data["task"], "OPENPYPE_USERNAME": instance.context.data["user"], - "OPENPYPE_LOG_NO_COLORS": "1", + "AYON_LOG_NO_COLORS": "1", "IS_TEST": str(int(is_in_tests())), "AYON_PUBLISH_JOB": "1", "AYON_RENDER_JOB": "0", diff --git a/client/ayon_core/modules/deadline/plugins/publish/submit_publish_job.py b/client/ayon_core/modules/deadline/plugins/publish/submit_publish_job.py index 31d57ed2b6..0729629208 100644 --- a/client/ayon_core/modules/deadline/plugins/publish/submit_publish_job.py +++ b/client/ayon_core/modules/deadline/plugins/publish/submit_publish_job.py @@ -190,7 +190,7 @@ class ProcessSubmittedJobOnFarm(pyblish.api.InstancePlugin, "AVALON_ASSET": instance.context.data["asset"], "AVALON_TASK": instance.context.data["task"], "OPENPYPE_USERNAME": instance.context.data["user"], - "OPENPYPE_LOG_NO_COLORS": "1", + "AYON_LOG_NO_COLORS": "1", "IS_TEST": str(int(is_in_tests())), "AYON_PUBLISH_JOB": "1", "AYON_RENDER_JOB": "0",