# 日志

export declare class SlugError extends Error {
    constructor(message?: string | Error, postion?: string);
}
interface ISlugConsole {
    debug(msg: string): string;
    log(msg: string): string;
    warn(msg: string): string;
    error(msg: string): SlugError;
}
export declare class SlugConsole implements ISlugConsole {
    private ns;
    constructor(ns: string);
    debug(msg: string): string;
    log(msg: string): string;
    succ(msg: string): string;
    warn(msg: string): string;
    error(msg: string | SlugError | Error): Error;
    private txt;
}

// 由于不利于 tree-shacking 已停止提供实例化导出
// export const slugConsole = new SlugConsole('SF');

使用 SlugConsole 输出日志应自建一个实例以添加命名空间前缀。

更新于: 6/21/2021, 2:26:41 PM