From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on gnuweeb.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NO_DNS_FOR_FROM,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 Received: from localhost.localdomain (unknown [175.158.50.43]) by gnuweeb.org (Postfix) with ESMTPSA id EE95B7F937; Wed, 18 Jan 2023 17:54:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1674064467; bh=EYDmVjAa+3ElUUEqmSK1HCoNRTgaMyHIwJHF7k4ZGdo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Yb6P9ojIuo6jvwomsCm/0L30vM+4b/uqp0cDSvYwn8IQWLVyaGDZSt2EfrPJH8XcW 2piQWM5VwT6P8BiiW4jC/T40AwUSYEwYcQKlhPAAgWSmOeSImE0tScBYvDne+ioeMf x+zIdrN+GCZb/rkQV2iKrY31/QUBMK9yyL9Zt8pH/MZXpuuPBfzrzF/VJ+S42pjV95 YX3I0wFBsQR8AK3dJnSKZ12M2lnEM3yFMVNznilIYSZXn2LkjWxLIt9S+QXV42upG+ 7MWweqcVzNR1Z2Z/mK2LjveYG4Z2XNP3P9QCDOrN8LUH/Nm4BoD0IzAlcwzDR6egGo mN80lSQHi7cGg== From: Muhammad Rizki To: Ammar Faizi Cc: Muhammad Rizki , Alviro Iskandar Setiawan , GNU/Weeb Mailing List Subject: [PATCH v2 06/17] discord: logger: Initialize the configuration for the Discord logger. Date: Thu, 19 Jan 2023 00:53:45 +0700 Message-Id: <20230118175356.1853-7-kiizuha@gnuweeb.org> X-Mailer: git-send-email 2.34.1.windows.1 In-Reply-To: <20230118175356.1853-1-kiizuha@gnuweeb.org> References: <20230118175356.1853-1-kiizuha@gnuweeb.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: This commit adds the configuration for the logger and sets the logger level of other loggers, such as pyrogram, to the WARNING level. Changing the level is to disable some of their log messages, so that only our bot logs to the console. Signed-off-by: Muhammad Rizki --- daemon/dc.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/daemon/dc.py b/daemon/dc.py index 7d34837..f4eeefb 100644 --- a/daemon/dc.py +++ b/daemon/dc.py @@ -4,6 +4,8 @@ # import os +import logging +import logging.config from dotenv import load_dotenv from mysql import connector from apscheduler.schedulers.asyncio import AsyncIOScheduler @@ -29,6 +31,10 @@ def main(): logger = BotLogger(Platform.DISCORD) logger.init() + logging.config.fileConfig("dscord/discord.logger.conf") + logging.getLogger("apscheduler").setLevel(logging.WARNING) + logging.getLogger("discord").setLevel(logging.WARNING) + client = GWClient( db_conn=connector.connect( host=os.getenv("DB_HOST"), -- Muhammad Rizki