From e4442bbb73f30ba02ac8a9023edce8b3b874a43e Mon Sep 17 00:00:00 2001 From: BryantHe Date: Wed, 31 May 2023 03:30:04 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20chassis?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- chassis/chassis.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/chassis/chassis.py b/chassis/chassis.py index 646ea98..7fdcc51 100644 --- a/chassis/chassis.py +++ b/chassis/chassis.py @@ -1,15 +1,12 @@ -import logging -from logstash_formatter import LogstashFormatterV1 -from statsd import StatsClient -from nameko_sentry import SentryReporter - - def init_statsd(prefix=None, host=None, port=8125): + from statsd import StatsClient statsd = StatsClient(host, port, prefix=prefix) return statsd def init_logger(): + import logging + from logstash_formatter import LogstashFormatterV1 logger = logging.getLogger() handler = logging.StreamHandler() formatter = LogstashFormatterV1() @@ -19,4 +16,5 @@ def init_logger(): def init_sentry(): + from nameko_sentry import SentryReporter return SentryReporter()