react-native-custom-log
v1.0.1
Published
CustomLog is a lightweight and flexible JavaScript/Node.js utility that enhances standard logging by adding custom colors and styles to console outputs. This is particularly useful for visually differentiating logs like errors, warnings, success messages,
Downloads
11
Maintainers
Readme
React Native Custom Logger
A simple, color-coded logger utility for logging messages with different log levels in the terminal. This logger supports log types like info, debug, warn, error, and success, each with its own ANSI color code for easy differentiation. It also includes a timestamp and the screen name for better debugging context.
Features:
Color-Coded Logs: Messages are displayed with distinct colors based on their type (e.g., error in red, success in green).
Timestamps: Each log message includes the current date and time. Screen Name Context: Optionally log which screen or module the log is coming from.
Easy to Use: Just pass the message, screen name, and type of log (e.g., error, info), and it will format and print the log message in the console.
Installation
npm install -D react-native-custom-log
Usage
Here’s how to use the customLogger:
import { customLogger } from 'react-native-custom-log';
customLogger({messg: 'Hello World',screenName: 'Dashboard',type: 'error'});