Please tell us about your environment:
winston version?
node -v outputs: v10.15.0
- Operating System? macOS 10.14.2
- Language? TypeScript 3.2.4
What is the problem?
When using TypeScript cannot use the defaultMeta option without getting a type error.
import winston from 'winston';
const logger = winston.createLogger({
defaultMeta: { service: 'my-service' },
});
Returns:
Argument of type '{ defaultMeta: { service: string; }; }' is not assignable to parameter of type 'LoggerOptions'.
Object literal may only specify known properties, and 'defaultMeta' does not exist in type 'LoggerOptions'. [2345]
What do you expect to happen instead?
It should compile.
Other information
An appropriate type for defaultMeta? should be added at https://github.com/winstonjs/winston/blob/master/index.d.ts#L73
Please tell us about your environment:
winstonversion?winston@2winston@3node -voutputs: v10.15.0What is the problem?
When using TypeScript cannot use the
defaultMetaoption without getting a type error.Returns:
What do you expect to happen instead?
It should compile.
Other information
An appropriate type for
defaultMeta?should be added at https://github.com/winstonjs/winston/blob/master/index.d.ts#L73