本文整理汇总了TypeScript中winston.Logger.debug方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Logger.debug方法的具体用法?TypeScript Logger.debug怎么用?TypeScript Logger.debug使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类winston.Logger
的用法示例。
在下文中一共展示了Logger.debug方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: new
const init = () => {
let quipLevels = {
levels: {
error: 0,
warn: 1,
info: 2,
verbose: 3,
debug: 4,
silly: 5
},
colors: {
error: 'red',
warn: 'yellow',
info: 'green',
verbose: 'blue',
debug: 'purple',
silly: 'pink'
}
};
let quipTransports = [
new (winston.transports.Console) ({
colorize: true,
level: (process.env.NODE_ENV == 'development') ? 'debug' : 'info',
handleExceptions: true,
json: false
}),
new (winston.transports.File) ({
colorize: false,
filename: 'log/quip.log',
handleExceptions: true,
json: true,
level: 'warn',
maxsize: 5242880,
maxFiles: 5
})
];
logger = new (winston.Logger) ({
levels: quipLevels.levels,
transports: quipTransports
});
logger.debug("Initiated logging.");
};
示例2: debug
export function debug(str, meta?) {
if (meta) return logger.debug(str, meta);
return logger.debug(str);
}
示例3: new
import winston from "winston";
import { Logger } from "winston";
const logger = new (Logger)({
transports: [
new (winston.transports.Console)({ level: process.env.NODE_ENV === "production" ? "error" : "debug" }),
new (winston.transports.File)({ filename: "debug.log", level: "debug"}),
],
});
if (process.env.NODE_ENV !== "production") {
logger.debug("Logging initialized at debug level");
}
export default logger;
示例4: next
export const reduxMiddleware = (store: Store<State>) => next => (action: Action) => {
logger.debug("dispatching", {type: ActionType[action.type], action})
let result = next(action)
if (!store.getState().corked) logger.debug("next state", debugState(store.getState()))
return result
}
示例5: debug
public debug(message:string){
winston_logger.debug(message);
}
示例6: parse
debug: (message: string, ...args: any[]) => {
if (Environment.isProduction()) {
logger.debug(format(scope, message), parse(args));
}
scopeDebug(message, parse(args));
},