
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
@sapphire/plugin-logger
Advanced tools
A Logger implementation that implements Sapphire's ILogger interface and implements timestamp and style formatting
with the blazing fast colorette library.
NO_COLOR friendly, inherited by colorette@sapphire/plugin-logger depends on the following packages. Be sure to install these along with this package!
You can use the following command to install this package, or replace npm install with your package manager of choice.
npm install @sapphire/plugin-logger @sapphire/framework
This registers the necessary options and methods in the Sapphire client to be able to use the log plugin.
// Main bot file
// Be sure to register the plugin before instantiating the client.
import '@sapphire/plugin-logger/register';
In order to use the Logger in any place other than a piece (commands, arguments, preconditions, etc.), you must first import the container property of @sapphire/framework. For pieces, you can simply use this.container.logger to access Logger methods.
import { container } from '@sapphire/framework';
export class MyAwesomeService {
public printAwesomeLog() {
container.logger.info('log message');
}
}
Here is an example ping command, demonstrating the use of this.container.logger from within a piece by omitting the explicit import.
// ping command
import { Command } from '@sapphire/framework';
import type { Message } from 'discord.js';
export class PingCommand extends Command {
public constructor(context: Command.LoaderContext, options: Command.Options) {
super(context, {
...options,
description: 'ping pong'
});
}
public async messageRun(message: Message) {
this.container.logger.warn('warning message');
}
}
tracedebuginfowarnerrorfatalExample:
container.logger.debug('log debug message');
Sapphire Community is and always will be open source, even if we don't get donations. That being said, we know there are amazing people who may still want to donate just to show their appreciation. Thank you very much in advance!
We accept donations through Open Collective, Ko-fi, Paypal, Patreon and GitHub Sponsorships. You can use the buttons below to donate through your method of choice.
| Donate With | Address |
|---|---|
| Open Collective | Click Here |
| Ko-fi | Click Here |
| Patreon | Click Here |
| PayPal | Click Here |
Please make sure to read the Contributing Guide before making a pull request.
Thank you to all the people who already contributed to Sapphire!
FAQs
Plugin for @sapphire/framework to have pretty console output
The npm package @sapphire/plugin-logger receives a total of 1,730 weekly downloads. As such, @sapphire/plugin-logger popularity was classified as popular.
We found that @sapphire/plugin-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
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.