From 6c087b86ffdcd8fa2350986f601cc1eee5d1c9d7 Mon Sep 17 00:00:00 2001 From: constient-altrova Date: Thu, 23 May 2024 05:06:53 +0000 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=94=84=20synced=20local=20'logfire/'?= =?UTF-8?q?=20with=20remote=20'logfire/'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- logfire/handler.py | 38 +++++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/logfire/handler.py b/logfire/handler.py index be919ee..5ee22cb 100644 --- a/logfire/handler.py +++ b/logfire/handler.py @@ -8,7 +8,7 @@ from .uploader import Uploader from .frame import create_frame -DEFAULT_HOST = 'https://in.logfire.sh' +DEFAULT_HOST = "https://in.logfire.ai" DEFAULT_BUFFER_CAPACITY = 1000 DEFAULT_FLUSH_INTERVAL = 1 DEFAULT_RAISE_EXCEPTIONS = False @@ -17,16 +17,18 @@ class LogfireHandler(logging.Handler): - def __init__(self, - source_token, - host=DEFAULT_HOST, - buffer_capacity=DEFAULT_BUFFER_CAPACITY, - flush_interval=DEFAULT_FLUSH_INTERVAL, - raise_exceptions=DEFAULT_RAISE_EXCEPTIONS, - drop_extra_events=DEFAULT_DROP_EXTRA_EVENTS, - include_extra_attributes=DEFAULT_INCLUDE_EXTRA_ATTRIBUTES, - context=DEFAULT_CONTEXT, - level=logging.NOTSET): + def __init__( + self, + source_token, + host=DEFAULT_HOST, + buffer_capacity=DEFAULT_BUFFER_CAPACITY, + flush_interval=DEFAULT_FLUSH_INTERVAL, + raise_exceptions=DEFAULT_RAISE_EXCEPTIONS, + drop_extra_events=DEFAULT_DROP_EXTRA_EVENTS, + include_extra_attributes=DEFAULT_INCLUDE_EXTRA_ATTRIBUTES, + context=DEFAULT_CONTEXT, + level=logging.NOTSET, + ): super(LogfireHandler, self).__init__(level=level) self.source_token = source_token self.host = host @@ -40,10 +42,7 @@ def __init__(self, self.raise_exceptions = raise_exceptions self.dropcount = 0 self.flush_thread = FlushWorker( - self.uploader, - self.pipe, - self.buffer_capacity, - self.flush_interval + self.uploader, self.pipe, self.buffer_capacity, self.flush_interval ) if self._is_main_process(): self.flush_thread.start() @@ -56,7 +55,12 @@ def emit(self, record): if self._is_main_process() and not self.flush_thread.is_alive(): self.flush_thread.start() message = self.format(record) - frame = create_frame(record, message, self.context, include_extra_attributes=self.include_extra_attributes) + frame = create_frame( + record, + message, + self.context, + include_extra_attributes=self.include_extra_attributes, + ) try: self.pipe.put(frame, block=(not self.drop_extra_events)) except queue.Full: @@ -66,4 +70,4 @@ def emit(self, record): pass except Exception as e: if self.raise_exceptions: - raise e \ No newline at end of file + raise e From 6f37a5be80eac1b8fb45ecc4cb44c88430d5d583 Mon Sep 17 00:00:00 2001 From: constient-altrova Date: Thu, 23 May 2024 05:06:53 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=94=84=20synced=20local=20'pyproject.?= =?UTF-8?q?toml'=20with=20remote=20'pyproject.toml'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pyproject.toml | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 5a881ec..9717dd6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,10 +4,10 @@ build-backend = "setuptools.build_meta" [project] name = "logfire-python" -version = "0.0.7" -description = "Logfire.sh client library" +version = "0.0.9" +description = "Logfire.ai client library" readme = "README.md" -authors = [{ name = "Logfire", email = "support@logfire.sh" }] +authors = [{ name = "Logfire", email = "support@logfire.ai" }] license = { file = "LICENSE" } classifiers = [ "Intended Audience :: Developers", @@ -27,13 +27,16 @@ classifiers = [ "Topic :: Software Development :: Libraries :: Python Modules", ] keywords = ["api", "logfire", "logging", "client"] -dependencies = [ - "requests", - "msgpack", -] +dependencies = ["requests", "msgpack"] [project.optional-dependencies] -dev = ["coverage>=3.7.1", "httpretty>=0.9.4", "nose>=1.3.7", "unittest2>=0.8.0", "mock>=1.0.1"] +dev = [ + "coverage>=3.7.1", + "httpretty>=0.9.4", + "nose>=1.3.7", + "unittest2>=0.8.0", + "mock>=1.0.1", +] [project.urls] Homepage = "https://github.com/logfire-sh/logfire-python"