
Security News
npm Adopts OIDC for Trusted Publishing in CI/CD Workflows
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
A versatile Python logging utility with rich console output and file logging capabilities.
pip install openlog
from openlog import Logger
# Basic console-only logger
logger = Logger()
logger.log("This is an info message")
logger.error("Something went wrong")
logger.warn("This is a warning")
logger.init("System initialized")
# Logger with file output
file_logger = Logger(write_to_file=True)
file_logger.log("This message goes to console and file")
# Session-based logging (new log file for each session)
session_logger = Logger(write_to_file=True, session=True)
session_logger.log("Logged with timestamp in filename")
# Store logs in a specific directory
dir_logger = Logger(in_dir=True, write_to_file=True)
dir_logger.log("Logs stored in /logs directory")
# Using custom prefixes for better log organization
module_logger = Logger(prefix="DATABASE")
module_logger.log("Connected to database") # Will show as "[DATABASE] Connected to database"
# Retrieve logs programmatically
logs = file_logger.flush_logs()
all_logs = file_logger.flush_logs(from_start=True)
log()
- General information (blue)error()
- Error messages (red)warn()
- Warning messages (yellow)init()
- Initialization messages (purple)The Logger
class accepts the following parameters:
in_dir
(bool): Store logs in a '/logs' directorysession
(bool): Create unique log files with timestampswrite_to_file
(bool): Enable file loggingprefix
(str): Optional prefix added to all log messages (e.g., module name, component identifier)MIT License
FAQs
Open-source minimal Rich-based logging solution
We found that openlog 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
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.
Security News
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.