diff --git a/pathwaysutils/__init__.py b/pathwaysutils/__init__.py index 7bd8f58..e6654c5 100644 --- a/pathwaysutils/__init__.py +++ b/pathwaysutils/__init__.py @@ -18,7 +18,6 @@ import os import jax -from pathwaysutils import cloud_logging from pathwaysutils import profiling from pathwaysutils import proxy_backend from pathwaysutils.persistence import orbax_handler @@ -101,13 +100,6 @@ def initialize() -> None: # compilation cache. jax.config.update("jax_enable_compilation_cache", False) - try: - cloud_logging.setup() - except Exception as error: # pylint: disable=broad-except - _logger.debug( - "Failed to set up cloud logging due to the following error: %s", - error, - ) else: _logger.debug( "Did not detect Pathways-on-Cloud backend. No changes applied." diff --git a/pathwaysutils/cloud_logging.py b/pathwaysutils/cloud_logging.py deleted file mode 100644 index 8064aa9..0000000 --- a/pathwaysutils/cloud_logging.py +++ /dev/null @@ -1,21 +0,0 @@ -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -"""Package for setting up Cloud Logging for Python.""" - -import google.cloud.logging - - -def setup(): - client = google.cloud.logging.Client() - client.setup_logging() diff --git a/pathwaysutils/test/pathwaysutils_test.py b/pathwaysutils/test/pathwaysutils_test.py index d48fcb2..a2fedd9 100644 --- a/pathwaysutils/test/pathwaysutils_test.py +++ b/pathwaysutils/test/pathwaysutils_test.py @@ -15,10 +15,8 @@ import os from unittest import mock -import google.cloud.logging import jax import pathwaysutils -from pathwaysutils import cloud_logging from absl.testing import absltest from absl.testing import parameterized @@ -26,20 +24,10 @@ class PathwaysutilsTest(parameterized.TestCase): - def setUp(self): - super().setUp() - self.mock_setup_logging = mock.patch.object( - cloud_logging, "setup", autospec=True - ) - def test_first_initialize(self): jax.config.update("jax_platforms", "proxy") pathwaysutils._initialization_count = 0 - self.enter_context( - mock.patch.object(google.cloud.logging, "Client", autospec=True) - ) - with self.assertLogs(pathwaysutils._logger, level="DEBUG") as logs: pathwaysutils.initialize()