1.2.4 • Published 4 years ago
crystolnetwork-log v1.2.4
English Information
This module was developed in order to assist CrystolNetwork's logging activities.
Installation
npm install crystolnetwork-log
How to use it in Javascript
const crystol = require("crystolnetwork-log");
[NEW] - Support timeZones (Default: America/Sao_Paulo)
crystol.log("Hello world!!", "helloworld.log", "America/New_York") // (timeZone, America/Sao_Paulo, etc)
// Define a simple record.
crystol.log("Hello world!!", "helloworld.log") // (txt, log, etc)
// Define a record within a folder.
// NOTE: Always check first if this folder directed in the registry exists.
crystol.log("Hello world!!", "./records/helloworld.log") // (txt, log, etc)
// Remove a record.
crystol.remove("helloworld.log")
// Verify that the file exists
if (crystol.exists('helloworld.log')) console.log("✅")
// Send a colorful message on the console.
crystol.error("Hello error!") -> red message
crystol.warn("Hello warn!") -> yellow message
crystol.debug("Hello debug!") -> blue message
// Use a core system based on Minecraft
crystol.text("&0Oi, tudo bem?") -> mensagem preto
// Prevent errors and still record any possible errors with:
crystol.debugFunction(() => {
// Your entire code here.
function test() {
return console.log(user) // Return user is not defined (error)
}
test()
}, "teste.log")
// Location/name of the file that will be responsible for saving any errors that may occur.
LICENSE
This project is licensed under the Apache License 2.0