
Security News
Meet Socket at Black Hat Europe and BSides London 2025
Socket is heading to London! Stop by our booth or schedule a meeting to see what we've been working on.
metalmental-logger
Advanced tools
A simple logger library that outputs logs to both standard output and a file by specifying the log level
MetalMental Loggerは、ログレベルを指定するだけで、標準出力およびファイルにログを出力するシンプルなロガーライブラリです
https://pypi.org/project/metalmental-logger/
pip install metalmental-logger
vi sample.py
import logging
from metalmental_logger.logger import metalmental_logger
# ロガーのインスタンスを作成
logger = metalmental_logger(log_level=logging.DEBUG)
def sample_function():
# ログメッセージを出力
logger.debug("これはデバッグメッセージです")
logger.info("これは情報メッセージです")
logger.warning("これは警告メッセージです")
logger.error("これはエラーメッセージです")
logger.critical("これは重大なエラーメッセージです")
sample_function()
python sample.py
[prompt]$ python sample.py
[2024-09-11 19:48:53.889 JST] [DEBUG] [9行目] [関数名: sample_function] これはデバッグメッセージです
[2024-09-11 19:48:53.889 JST] [INFO] [10行目] [関数名: sample_function] これは情報メッセージです
[2024-09-11 19:48:53.889 JST] [WARNING] [11行目] [関数名: sample_function] これは警告メッセージです
[2024-09-11 19:48:53.889 JST] [ERROR] [12行目] [関数名: sample_function] これはエラーメッセージです
[2024-09-11 19:48:53.889 JST] [CRITICAL] [13行目] [関数名: sample_function] これは重大なエラーメッセージです
[prompt]$
[prompt]$
[prompt]$ cat logs/2024-09-11.log
[2024-09-11 19:48:53.889 JST] [DEBUG] [9行目] [関数名: sample_function] これはデバッグメッセージです
[2024-09-11 19:48:53.889 JST] [INFO] [10行目] [関数名: sample_function] これは情報メッセージです
[2024-09-11 19:48:53.889 JST] [WARNING] [11行目] [関数名: sample_function] これは警告メッセージです
[2024-09-11 19:48:53.889 JST] [ERROR] [12行目] [関数名: sample_function] これはエラーメッセージです
[2024-09-11 19:48:53.889 JST] [CRITICAL] [13行目] [関数名: sample_function] これは重大なエラーメッセージです
[prompt]$
MITライセンスで提供されています
詳細はLICENSEファイルを参照してください
MetalMental - flupino@metalmental.net
FAQs
A simple logger library that outputs logs to both standard output and a file by specifying the log level
We found that metalmental-logger demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Socket is heading to London! Stop by our booth or schedule a meeting to see what we've been working on.

Security News
OWASP’s 2025 Top 10 introduces Software Supply Chain Failures as a new category, reflecting rising concern over dependency and build system risks.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.