
Research
/Security News
Weaponizing Discord for Command and Control Across npm, PyPI, and RubyGems.org
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
@braken/logger
Advanced tools
Braken 框架的日志模块,提供彩色控制台日志输出支持。
pnpm add @braken/logger
import { Application } from '@braken/application';
import Logger from '@braken/logger';
// 创建日志实例
const logger = new Logger();
// 记录不同级别的日志
logger.error('错误信息');
logger.info('普通信息');
logger.notice('通知信息');
logger.http('HTTP 请求');
logger.warn('警告信息');
logger.silly('调试信息');
// 使用依赖注入
@Application.Injectable
class MyService {
@Application.Inject(Logger)
private readonly logger: Logger;
async doSomething() {
this.logger.info('开始执行任务');
try {
// 执行任务
this.logger.notice('任务执行成功');
} catch (error) {
this.logger.error('任务执行失败:', error);
}
}
}
主要的日志类,提供以下功能:
记录错误信息:
error(...args: any[])
记录普通信息:
info(...args: any[])
记录通知信息:
notice(...args: any[])
记录 HTTP 请求:
http(...args: any[])
记录警告信息:
warn(...args: any[])
记录调试信息:
silly(...args: any[])
@Application.Injectable
class MyService {
@Application.Inject(Logger)
private readonly logger: Logger;
}
MIT
FAQs
somethings
We found that @braken/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.
Research
/Security News
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
Security News
Socket now integrates with Bun 1.3’s Security Scanner API to block risky packages at install time and enforce your organization’s policies in local dev and CI.
Research
The Socket Threat Research Team is tracking weekly intrusions into the npm registry that follow a repeatable adversarial playbook used by North Korean state-sponsored actors.