
Company News
Andrew Becherer Joins Socket as Chief Information Security Officer
Socket’s first CISO brings deep experience securing high-growth SaaS companies as open source supply chain threats accelerate.
@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
The npm package @braken/logger receives a total of 15 weekly downloads. As such, @braken/logger popularity was classified as not popular.
We found that @braken/logger demonstrated a not healthy version release cadence and project activity because the last version was released 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.

Company News
Socket’s first CISO brings deep experience securing high-growth SaaS companies as open source supply chain threats accelerate.

Company News
Replit is integrating Socket Firewall into its AI-powered development experience to help protect builders from malicious open source packages.

Security News
npm confirmed a tooling bug incorrectly marked several one-character packages as security holders and said it was working on a rollback.