1.0.0 • Published 11 months ago

logger-ai v1.0.0

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

AI logger

Logger-AI is an intelligent, easy-to-use logging module, with the ability to handle global errors, provide error context, and offer repair suggestions using AI technology.

Installation

Logger-AI is already available on the npm list. You can install it using npm with the following command:

npm install logger-ai

Use

Importing Modules

To use Logger in your project, import this module:

const { setLanguage } = require('logger-ai');

Set Language (EN/ID)

By default, Logger-AI uses English ('en'). You can change to Indonesian by using the setLanguage function:

setLanguage('id');

Handle Errors

Logger-AI automatically handles global errors such as uncaughtException and unhandledRejection. You don't need to add any special settings to handle this error; Logger-AI is set to do this automatically.

Using Logger

To start logging, simply create an instance of Logger and let it handle errors automatically:

const { setLanguage } = require('logger-ai');
setLanguage('id');

require('./your-base-app');

Feature

  • Global Error Logging: Handles uncaughtException, unhandledRejection, and uncaughtExceptionMonitor.
  • Error Context Provision: Provides context lines around the error to aid in debugging.
  • AI Suggestions: Send error logs to the API to get AI-based fix suggestions.
  • Language Settings: Supports English and Indonesian for AI suggestions.
1.0.0

11 months ago