
Security News
Vite+ Joins the Push to Consolidate JavaScript Tooling
Evan You announces Vite+, a commercial, Rust-powered toolchain built on the Vite ecosystem to unify JavaScript development and fund open source.
@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 40 weekly downloads. As such, @braken/logger popularity was classified as not popular.
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.
Security News
Evan You announces Vite+, a commercial, Rust-powered toolchain built on the Vite ecosystem to unify JavaScript development and fund open source.
Security News
Ruby Central’s incident report on the RubyGems.org access dispute sparks backlash from former maintainers and renewed debate over project governance.
Research
/Security News
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.