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 982BE7F937; Wed, 18 Jan 2023 17:54:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1674064463; bh=5gmDVetDqqzKOvE2mkbpQoKc8MppLRWDKRtwYNyCKFw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AxOKPmc2XTgQNmdNr4653eWr2S28EFuUBd+KrbEmUGNrIKYYMwI8+uu/CO65Bzujv 2terwSBTNPJvr6G8et8LBY6YY4siJw2SJGHwmOI7nfmkUFPW8BkYz5dGk1nW1++KzX 0Ze7Mm5LychEKr3xbqS2yQE//xK5EMak6wGOq9OBR8P1RoOZ0QWb1ZS+0ktquLzdWK r3/dOqI1azKeaG5w2lfCf71ZEhL+tqtPCbLbbaT0PLGMy4qepLqnn6TUaIxQZnWGfL ZZS2EAiSET4JpyWViRdgwcqlKrBq2RGmBTlAGy8nm2yEAlBTPikmmDDycNDdjsGUSO 5Dk6xEW3uOENA== From: Muhammad Rizki To: Ammar Faizi Cc: Muhammad Rizki , Alviro Iskandar Setiawan , GNU/Weeb Mailing List Subject: [PATCH v2 04/17] discord: logger: Add a discord.logger.conf Date: Thu, 19 Jan 2023 00:53:43 +0700 Message-Id: <20230118175356.1853-5-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: Add a logger configuration file for improved configuration, debugging, and management. This method is cleaner than before and the BotLogger() will be removed in the future. Signed-off-by: Muhammad Rizki --- daemon/dscord/discord.logger.conf | 36 +++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 daemon/dscord/discord.logger.conf diff --git a/daemon/dscord/discord.logger.conf b/daemon/dscord/discord.logger.conf new file mode 100644 index 0000000..97b5e11 --- /dev/null +++ b/daemon/dscord/discord.logger.conf @@ -0,0 +1,36 @@ +[loggers] +keys=root,dscord + +[handlers] +keys=consoleHandler,fileHandler + +[formatters] +keys=sampleFormatter,dictFormatter + +[logger_root] +level=INFO +handlers=consoleHandler,fileHandler + +[logger_dscord] +level=INFO +handlers=consoleHandler +qualname=dscord +propagate=0 + +[handler_consoleHandler] +class=StreamHandler +level=INFO +formatter=sampleFormatter +args=(sys.stdout,) + +[handler_fileHandler] +class=FileHandler +level=WARNING +formatter=dictFormatter +args=("dscord/storage/discord.log",) + +[formatter_sampleFormatter] +format=%(asctime)s - %(name)s: %(funcName)s - %(levelname)s - %(message)s + +[formatter_dictFormatter] +format={"time": "%(asctime)s", "func": "%(name)s: %(funcName)s", "path": "%(pathname)s", "level": "%(levelname)s", "msg": "%(message)s"} -- Muhammad Rizki