@monkeyscanjump/cloudflare-dyndns
Version:
A robust TypeScript application that automatically updates Cloudflare DNS records when your public IP address changes. Perfect for maintaining consistent domain names for home servers, WireGuard VPN, self-hosted services, or any system with a dynamic IP a
53 lines (52 loc) • 1.55 kB
TypeScript
export type LogLevel = 'debug' | 'info' | 'warn' | 'error';
/**
* Handles application logging with console and file output
* Supports multiple severity levels and automatic log directory creation
*/
export declare class Logger {
private logFile;
private debugEnabled;
/**
* Creates a new logger instance
* @param logFile Path to the log file where messages will be stored
*/
constructor(logFile: string);
/**
* Enables or disables debug-level logging
* @param enabled Whether debug messages should be logged
*/
setDebugMode(enabled: boolean): void;
/**
* Checks if debug mode is currently enabled
* @returns True if debug logging is enabled
*/
isDebugEnabled(): boolean;
/**
* Logs a message with the specified severity level
* Writes to both console and log file
* @param message Message text to log
* @param level Severity level of the message
*/
log(message: string, level?: LogLevel): void;
/**
* Logs a debug-level message
* Only logged if debug mode is enabled
* @param message Debug message to log
*/
debug(message: string): void;
/**
* Logs an informational message
* @param message Info message to log
*/
info(message: string): void;
/**
* Logs a warning message
* @param message Warning message to log
*/
warn(message: string): void;
/**
* Logs an error message
* @param message Error message to log
*/
error(message: string): void;
}