1.0.5 • Published 11 months ago

mcstatusbot-logger v1.0.5

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

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

1.0.5

11 months ago

1.0.4

12 months ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago