From bd0047b6a83cef1daff979c8a28d40ff4b30c27f Mon Sep 17 00:00:00 2001 From: BryantHe Date: Tue, 30 May 2023 04:57:13 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20chassis=202?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- chassis/chassis.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/chassis/chassis.py b/chassis/chassis.py index c80155d..afdeae8 100644 --- a/chassis/chassis.py +++ b/chassis/chassis.py @@ -1,7 +1,9 @@ +import os import logging from logstash_formatter import LogstashFormatterV1 from statsd import StatsClient from nameko_sentry import SentryReporter +from dotenv import load_dotenv def init_statsd(prefix=None, host=None, port=8125): @@ -19,4 +21,8 @@ def init_logger(): def init_sentry(): - return SentryReporter() \ No newline at end of file + return SentryReporter() + + +def init_dotenv(env_file='.nameko.env'): + load_dotenv(os.path.join(os.getcwd(), env_file)) \ No newline at end of file