Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type mismatch between Logger.level in log4js.d.ts and logger.js #1010

Closed
jayarajanp opened this issue May 14, 2020 · 1 comment · Fixed by #1118
Closed

Type mismatch between Logger.level in log4js.d.ts and logger.js #1010

jayarajanp opened this issue May 14, 2020 · 1 comment · Fixed by #1118
Milestone

Comments

@jayarajanp
Copy link

Type of getLogger().level shown by VS Code intellisense is string. But when I run it, I'm getting Level object.

It seems there is a mismatch between Logger class in log4js.d.ts and logger.js (please refer the attached image), or I'm missing something here.

mismatch

@rnd-debug
Copy link
Contributor

@PJone Can you check if using a union type in log4js.d.ts will work properly ?

export class Logger {
...
	level: Level | string;
...
}

( using union type instead of simply Level, because log4js is using get/set accessors of different types for the Logger.level: getting a Level, but allowing to set from a Level or a String)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants