@isaac-platform/isaac-integration-sdk
Version:
A Typescript SDK for integrating with ISAAC
69 lines • 3.62 kB
TypeScript
import { isaacLogEntry, isaacLogLevels } from "./types.js";
/**
* Logger module for creating and managing log entries
*/
export declare class Logger {
/**
* Creates a new Logger instance
*/
constructor();
/**
* Creates a new log entry
* @param key - The key of the log entry. This is used to identify the log entry in the UI.
* @param message - The log message. This is the actual content of the log entry.
* @param level - The severity level of the log. Must be one of "debug", "info", "warn", "error", or "critical". Default is "info".
* @param tags - An array of tags to apply to the log entry.
* @returns The created log entry.
*/
createLogEntry: (key: string, message: string, level: isaacLogLevels | "info", tags?: string[]) => isaacLogEntry;
/**
* Saves a log entry using the configured connection
* @param logEntry - The log entry to save
* @returns Promise resolving when the log is saved
*/
sendLogEntry: (logEntry: isaacLogEntry) => Promise<any>;
/**
* Creates and immediately sends a log entry to ISAAC
* @param key - The key of the log entry. This is used to identify the log entry in the UI.
* @param message - The log message. This is the actual content of the log entry.
* @param level - The severity level of the log. Must be one of "debug", "info", "warn", "error", or "critical". Default is "info".
* @param tags - An array of tags to apply to the log entry.
*/
log: (key: string, message: string, level?: isaacLogLevels, tags?: string[]) => void;
/**
* Convenience method for "debug" level logs.
* @param key - The key of the log entry. Thi is used to identify the log entry in the UI.
* @param message - The log message. This is the actual content of the log entry.
* @param tags - An optional string array of tags to apply to the log entry.
*/
debug: (key: string, message: string, tags?: string[]) => void;
/**
* Convenience method for "info" level logs.
* @param key - The key of the log entry. Thi is used to identify the log entry in the UI.
* @param message - The log message. This is the actual content of the log entry.
* @param tags - An optional string array of tags to apply to the log entry.
*/
info: (key: string, message: string, tags?: string[]) => void;
/**
* Convenience method for "warn" level logs.
* @param key - The key of the log entry. Thi is used to identify the log entry in the UI.
* @param message - The log message. This is the actual content of the log entry.
* @param tags - An optional string array of tags to apply to the log entry.
*/
warn: (key: string, message: string, tags?: string[]) => void;
/**
* Convenience method for "error" level logs.
* @param key - The key of the log entry. Thi is used to identify the log entry in the UI.
* @param message - The log message. This is the actual content of the log entry.
* @param tags - An optional string array of tags to apply to the log entry.
*/
error: (key: string, message: string, tags?: string[]) => void;
/**
* Convenience method for "critical" level logs.
* @param key - The key of the log entry. Thi is used to identify the log entry in the UI.
* @param message - The log message. This is the actual content of the log entry.
* @param tags - An optional string array of tags to apply to the log entry.
*/
critical: (key: string, message: string, tags?: string[]) => void;
}
//# sourceMappingURL=index.d.ts.map