logdna / logger-node

A nodejs logger client for LogDNA
MIT License
34 stars 17 forks source link

LogLevel undefined #47

Closed mgummelt closed 1 week ago

mgummelt commented 3 years ago

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.

xinthose commented 2 years ago

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",
};
darinspivey commented 2 years ago

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!

darinspivey commented 1 week ago

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.

logdnabot commented 1 week ago

:tada: This issue has been resolved in version 2.6.11 :tada:

The release is available on:

Your semantic-release bot :package::rocket: