@teclone/r-server
Version:
A lightweight, extensible web-server with inbuilt routing-engine, static file server, file upload handler, request body parser, middleware support and lots more
36 lines (35 loc) • 822 B
TypeScript
import { ServerRequest } from './Request';
import { ServerResponse } from './Response';
export interface LoggerOpts {
errorLogFile: string;
accessLogFile: string;
}
export declare class Logger {
private errorLogHandle;
private accessLogHandle;
constructor(opts: LoggerOpts);
/**
* log warning message to the console
*/
warn(message: string): this;
/**
* log info message to the console
*/
info(message: string): this;
/**
* close the handles once the server is closed
*/
close(): this;
/**
* runs the error logging
*/
logError(err: Error): this;
/**
* logs access information
*/
private logAccess;
/**
* log request response profile
*/
profile(req: ServerRequest, res: ServerResponse): this;
}