我正在使用 Winston 登录 Sails 应用程序。这是我的配置:
var customLogger = new winston.Logger({
transports: [
new(winston.transports.File)({
level: 'debug',
filename: 'app.log',
colorize: false,
showLevel: false,
prettyPrint: false,
exitOnError: false,
json: true,
zippedArchive: true,
maxsize: 1000000000,
maxFiles: 30,
tailable: true
}),
new(winston.transports.Console)({
level: 'info',
exitOnError: false,
colorize: false,
showLevel: false
})
],
});
Run Code Online (Sandbox Code Playgroud)
但在输出文件中存在奇怪的字符。
{"level":"info","message":"\u001b[32minfo: \u001b[39m","timestamp":"2016-05-12T17:58:03.281Z"}
Run Code Online (Sandbox Code Playgroud) 我需要使用react-select打字稿在所选值之前显示一个图标。
这是我到目前为止所尝试的:
SingleValue: React.SFC<SingleValueProps<OptionType>> = ({ children, ...props }) => (
<components.SingleValue {...props}>
<i className={`fal fa-${this.props.icon} has-text-grey-light`} /> {children}
</components.SingleValue>
)
Run Code Online (Sandbox Code Playgroud)
主要问题是类型定义期望传递给的子级components.SingleValue必须是字符串。