string-logger
TypeScript icon, indicating that this package has built-in type declarations

1.1.1 • Public • Published

string-logger

Specially built console logger for my projects extending Sapphire's logger.

  • How to use:

ESM:

import { StringLogger } from 'string-logger';

const logger = new StringLogger(20, 'string');

CJS:

const { StringLogger } = require('string-logger');

const logger = new StringLogger(20, 'string');
  • To use this logger with sapphire, add instance: new StringLogger(<level>, <name>) to your logger options.

  • Demo of logging with sapphire framework:

import { ApplyOptions } from '@sapphire/decorators';
import { Command } from '@sapphire/framework';

@ApplyOptions<Command.Options>({
  name: 'test',
  description: 'test!'
})
export class TestCommand extends Command {
  public registerApplicationCommands(registry: Command.Registry) {
    registry.registerChatInputCommand({
      name: this.name,
      description: this.description
    });
  }

  public async chatInputRun(interaction: Command.ChatInputCommandInteraction) {
    return this.container.logger.info('Test!');
  }
}

Readme

Keywords

none

Package Sidebar

Install

npm i string-logger

Weekly Downloads

0

Version

1.1.1

License

MIT

Unpacked Size

9.53 kB

Total Files

10

Last publish

Collaborators

  • ararou