Skip to content
Documentation
Logger system

Logger System in verse.db

At verse.db, we've incorporated a powerful built-in logger system that simplifies the process of logging information within our package. Whether you're debugging, monitoring, or simply keeping track of events, our logger provides an intuitive and straightforward way to manage logs.

Example Usage:

const versedb = require("verse.db");
 
// Initialize the logger
const log = versedb.logger;
 
// Log a success message
log.logSuccess({
  content: "This is a success log message",
  devLogs: {
    enable: true,
    path: "./path/to/log/dir",
  },
});
 
// Log an error message
log.logError({
  content: "This is an error log message",
  devLogs: {
    enable: true,
    path: "./path/to/log/dir",
  },
  throwErr: true, // If you want to throw an error instead of console.log, set this to true
});
 
// Log an informational message
log.logInfo({
  content: "This is an informational log message",
  devLogs: {
    enable: true,
    path: "./path/to/log/dir",
  },
});
 
// Log a warning message
log.logWarn({
  content: "This is a warning log message",
  devLogs: {
    enable: true,
    path: "./path/to/log/dir",
  },
});

How to Use:

  1. Import the logger module using const log = versedb.logger.
  2. Utilize the various log methods (logSuccess, logInfo, logWarn, and logError) with appropriate content and options.

Feel free to explore the versatility of our logger system and keep your development process organized! 📝🚀


VERSE.DB. Powered by JEDI Studio.