Package Exports
- node-telegram-log
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (node-telegram-log) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Telegram Logger
Simple Telegram logger for node.js.
Install
$ npm install node-telegram-logger
Prerequisites
Create telegram bot and get it's
token
:Add bot to group or go to bot's page and
/start
Get
chat_id
where bot will send messages. Feel free to use IDBot to getchat_id
Usage
const { TelegramLogger } = require("node-telegram-log");
const logger = new TelegramLogger(BOT_TOKEN_ID, CHAT_ID);
// Log some message
logger.log("Yuhuu! It's work");
// Formatted message
/**
* ℹ️ LOG
*
* Yuhuu! It's work
*/
// Or debug
logger.debug("Just debugging it", { canILogObjects: true });
// Formatted message
/**
* ⚙️ DEBUG
*
* Just debugging it
* {
* "canILogObjects": true
* }
*/
// Even errors are formatted
logger.error("Something went wrong: ", [1, { formatted: true }, "wow"]);
// Formatted message
/**
* 🆘 ERROR
*
* Something went wrong:
* [1,{"formatted":true},"wow"]
*/
Author
Joe Beretta
License
Copyright © 2020, Joe Beretta. Released under the MIT License.