logger-node
logger-node copied to clipboard
LogLevel undefined
I just installed @logdna/logger
, and am instantiating my logger as follows:
import logdna, { LogLevel } from "@logdna/logger";
const options = {
app: "Rover",
level: LogLevel.debug,
};
const logDNALogger = logdna.createLogger(<key>, options);
Then receiving the error:
**TypeError: Cannot read property 'debug' of undefined**
It doesn't seem the source provides any LogLevel
variable, despite the TS types file advertising that it does.
Yes, my code compiles fine with gulp, but when it's run with node, it fails. I use a string instead.
private logOptions: ConstructorOptions = {
level: config.debug ? "debug" : "info",
};
The intention was for it to be passed as a string, yes. This isn't a Typescript project, but we try to provide the typedefs as a convenience, albeit untested. If you see ways to improve it or fix bugs with those, please feel free to open a PR!
Sorry that this is so grossly out of date. There is an incoming fix that was tested locally against the code provided in this issue.
:tada: This issue has been resolved in version 2.6.11 :tada:
The release is available on:
Your semantic-release bot :package::rocket: