From b2161496ac2f142e1025edb57a07ee85afba3422 Mon Sep 17 00:00:00 2001 From: "shuizhao.gh" Date: Thu, 13 Nov 2025 16:38:50 +0800 Subject: [PATCH] fix: logItem nano time now become fourth pos in the ctor, which may cause a breaking change. --- HISTORY.md | 9 +++++++++ aliyun/log/logitem.py | 5 ++++- aliyun/log/version.py | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/HISTORY.md b/HISTORY.md index 9e35dce2..cf15825d 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,5 +1,14 @@ # Release History +## 0.9.36 (2025-11-13) + +**Breaking Changes** + +Fix: Adapt to [LogItem](aliyun/log/logitem.py) breaking change from v0.8.10 + +Updates code to reflect the new LogItem signature, where the +`nano_time_part` argument moved from the 3rd to the 4th position. + ## 0.9.35 (2025-11-05) **Feature** diff --git a/aliyun/log/logitem.py b/aliyun/log/logitem.py index faaa9513..b5d5037f 100755 --- a/aliyun/log/logitem.py +++ b/aliyun/log/logitem.py @@ -17,9 +17,12 @@ class LogItem(object): :type contents: tuple(key-value) list :param contents: the data of the log item, including many (key,value) pairs. + + :type time_nano_part: int + :param time_nano_part: time nano part of the log item, ranges from 0 to 999999999. """ - def __init__(self, timestamp=None, time_nano_part=None, contents=None): + def __init__(self, timestamp=None, contents=None, time_nano_part=None): nano_time = int(time.time() * 10**9) self.timestamp = int(timestamp) if timestamp else int(nano_time / 1000000000) # milliseconds diff --git a/aliyun/log/version.py b/aliyun/log/version.py index 200f7b25..3a0459af 100644 --- a/aliyun/log/version.py +++ b/aliyun/log/version.py @@ -1,4 +1,4 @@ -__version__ = '0.9.35' +__version__ = '0.9.36' import sys OS_VERSION = str(sys.platform)