
Security News
/Research
Popular node-ipc npm Package Infected with Credential Stealer
Socket detected malicious node-ipc versions with obfuscated stealer/backdoor behavior in a developing npm supply chain attack.
@dimjs/logger
Advanced tools
Simple, pretty and powerful logger for nodejs
Initialize
import { logger } from '@dimjs/logger';
logger.debug('hello', 'context');
And customized adapter with builtin sentry
import {
createLogger,
SentryAdapter,
SentryFormatStrategy,
} from '@dimjs/logger';
const logger = createLogger({
logLevel: LogLevel.Warn,
adapter: new SentryAdapter({
formatStrategy: new SentryFormatStrategy(),
}),
});
logger.debug('hello', 'context');
And customized adapters
// customize custom adapter
export class CustomAdapter<T> implements LogAdapter<T> {
isLoggable(priority: LogLevel, context?: string | undefined): boolean {
throw new Error('Method not implemented.');
}
config(config?: LogAdapterConfig | undefined): LogAdapter {
throw new Error('Method not implemented.');
}
print(priority: LogLevel, context: string, message: T, trace?: any): void {
throw new Error('Method not implemented.');
}
}
// customize custom format strategy for `CustomAdapter`
export class CustomFormatStrategy<T> implements FormatStrategy<T> {
print(priority: LogLevel, context: string, message: T, trace?: any): void {
throw new Error('Method not implemented.');
}
}
// create new logger
const logger = createLogger({
logLevel: LogLevel.Warn,
adapter: new SentryAdapter({
formatStrategy: new SentryFormatStrategy(),
}),
});
// attach new adapter
logger.addLogAdapter(
new SentryAdapter({
formatStrategy: new SentryFormatStrategy(),
})
);
logger.debug('print multi messages', 'demo');
FAQs
Simple, pretty and powerful logger for nodejs
We found that @dimjs/logger demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers 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
/Research
Socket detected malicious node-ipc versions with obfuscated stealer/backdoor behavior in a developing npm supply chain attack.

Security News
TeamPCP and BreachForums are promoting a Shai-Hulud supply chain attack contest with a $1,000 prize for the biggest package compromise.

Security News
Packagist urges PHP projects to update Composer after a GitHub token format change exposed some GitHub Actions tokens in CI logs.