Skip to content

Latest commit

 

History

History
36 lines (26 loc) · 845 Bytes

ILogger.md

File metadata and controls

36 lines (26 loc) · 845 Bytes

ILogger

A interface used in creating your own logger. This library includes ConsoleLogger which writes to console.log.

Usage

export interface ILogger {    
    log(...args: any[]): void;    
}

If your skill is hosted in AWS Lambda then the logs will appear in Amazon CloudWatch

Examples

//TypeScript
import { ConsoleLogger, ILogger } from "ask-community-interceptors";

const logger: ILogger = new ConsoleLogger();

Here is an example of how to use ILogger to create your own logger:

//TypeScript
import { ILogger } from './ILogger';

export class MyLogger implements ILogger {
    public log(...args: any[]): void {
        // implement log function
        // console.log.apply(console, arguments);
    }
}