kxn-multilogger-util
v1.3.2
Published
A package for sending logs from client and server in sitevision. Requires kxn-multilogger to be active in Sitevision.
Readme
send-log-package
A simple logging utility for sending logs from both client and server environments.
Installation
To install the package, run the following command:
npm install kxn-multilogger-utilUsage
Importing the Functions
You can import the functions in your project as follows:
import { sendLogFromClient } from 'kxn-multilogger-util/client'; // For client-side logging
import { sendLogFromServer } from 'kxn-multilogger-util/server'; // For server-side loggingSending Logs from Client
To send logs from the client, use the sendLogFromClient function:
sendLogFromClient('Your error log message', 'YourAppName', "error");Sending Logs from Server
To send logs from the server, use the sendLogFromServer function:
sendLogFromServer('Your error log message', 'YourAppName', "error");Error Types
The ErrorType-field is used to specify the type of error. It allows the following types, if none is specified, it defaults to ERROR:
ERROR: Represents an error.WARNING: Represents a warning.INFO: Represents an informational message.
License
This project is licensed under the MIT License - see the LICENSE file for details.
