Skip to content
This repository was archived by the owner on Feb 26, 2026. It is now read-only.

Commit ca58568

Browse files
authored
Merge branch 'main' into sink-storage
2 parents fe6044c + f4fb25a commit ca58568

7 files changed

Lines changed: 19 additions & 7 deletions

File tree

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "3.12.0"
2+
".": "3.12.1"
33
}

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@
44

55
[1]: https://pypi.org/project/google-cloud-logging/#history
66

7+
## [3.12.1](https://github.com/googleapis/python-logging/compare/v3.12.0...v3.12.1) (2025-04-21)
8+
9+
10+
### Bug Fixes
11+
12+
* Make logging handler close conditional to having the transport opened ([#990](https://github.com/googleapis/python-logging/issues/990)) ([66c6b91](https://github.com/googleapis/python-logging/commit/66c6b91725eb479a0af138a2be13f3c25f369d7e))
13+
714
## [3.12.0](https://github.com/googleapis/python-logging/compare/v3.11.4...v3.12.0) (2025-04-10)
815

916

google/cloud/logging/gapic_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
__version__ = "3.12.0" # {x-release-please-version}
16+
__version__ = "3.12.1" # {x-release-please-version}

google/cloud/logging_v2/gapic_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
__version__ = "3.12.0" # {x-release-please-version}
16+
__version__ = "3.12.1" # {x-release-please-version}

google/cloud/logging_v2/handlers/handlers.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -245,9 +245,10 @@ def flush(self):
245245

246246
def close(self):
247247
"""Closes the log handler and cleans up all Transport objects used."""
248-
self.transport.close()
249-
self.transport = None
250-
self._transport_open = False
248+
if self._transport_open:
249+
self.transport.close()
250+
self.transport = None
251+
self._transport_open = False
251252

252253

253254
def _format_and_parse_message(record, formatter_handler):

samples/generated_samples/snippet_metadata_google.logging.v2.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
],
99
"language": "PYTHON",
1010
"name": "google-cloud-logging",
11-
"version": "3.12.0"
11+
"version": "3.12.1"
1212
},
1313
"snippets": [
1414
{

tests/unit/handlers/test_handlers.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -901,6 +901,10 @@ def test_close(self):
901901
self.assertFalse(handler._transport_open)
902902
self.assertTrue(old_transport.close_called)
903903

904+
# second call to close shouldn't throw an exception
905+
handler.close()
906+
self.assertFalse(handler._transport_open)
907+
904908

905909
class TestFormatAndParseMessage(unittest.TestCase):
906910
def test_none(self):

0 commit comments

Comments
 (0)