mcstatusbot-logger

1.0.5 • Public • Published

logger

a simple logger that adds times log type and also add the logs to a file

setup

make an env file that will contain your config options

MCSB_LOGGER_PATH (string)

this is the path you will store all your log files in

  • starting it with ./ will make it relative to your project directory
  • starting it with / will make it relative to your root and you have to specify a full path

it is a good idea to place it in a logs direcotry because it makes multible archive files which can get messy

default: ./logs

MCSB_LOGGER_FILE_PREFIX (boolean)

if you want your log files to be prefixed with the type of log it is eg success, error.

default: false

example .env file
MCSB_LOGGER_PATH=./logs
MCSB_LOGGER_FILE_PREFIX=true

install the module

npm i mcstatusbot-logger

example

require('dotenv').config();
const logger = require('mcstatusbot-logger');


logger.success("you are now using logger by@mcstatusbot.site");
logger.info("you are now using logger by mcstatusbot.site");

docs

.sucess([string: message <default: "">], [boolean: log to file <default:true>])

sends a success message

.info([string: message <default: "">], [boolean: log to file <default:true>])

sends a info message

.warn([string: message <default: "">], [boolean: log to file <default:true>])

sends a warn message

.error([string: message <default: "">], [boolean: log to file <default:true>])

sends a error message

.crash([string: message <default: "">], [boolean: log to file <default:true>])

sends a crash message

/mcstatusbot-logger/

    Package Sidebar

    Install

    npm i mcstatusbot-logger

    Weekly Downloads

    3

    Version

    1.0.5

    License

    MIT

    Unpacked Size

    9.18 kB

    Total Files

    5

    Last publish

    Collaborators

    • 404invalid-user