-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
[Bug]: Property 'fatal' does not exist on type 'Logger' #2188
Comments
Side note, I had a thought that maybe it was because I also installed |
Using |
Facing the same issue |
Doesn't look like you can use |
yes, it's working now |
Had the same issue using Typescript. If you don't use the default levels from the Winston npm package, Typescript will throw you an error. My code looks a bit different but after calling "createLogger()" try to add: Like that you can add whatever level you want, it's more a typescript issue than a Winston issue, when using JavaScript I don't face the same implications. Take a look at my source, in case you need further explanation: https://stackoverflow.com/questions/53298354/winston-custom-log-levels-typescript-definitions |
Oh, I like this, I'll have to give it a look, thanks! Only concern I have - and again this is a TypeScript issue not Winston issue - is for my |
But why would you want different log levels? Would it not be better to define a standard that applies to each application, ensuring they use the same set of log levels? When thinking about analysing incoming logs, I'd say that will help keeping it consistent. Feel free to share your opinion why I might be wrong. |
You're not wrong at all, and that's what I've done. I do have a standard for all of my applications, in which the wrapper defaults to automatically. However, I still would like to build the package to be flexible enough to work for any other standards other than just mine. Package is private and most likely forever will be, it's soley for the sake of flexibility. |
Oh, I see. Now it makes more sense to me. In case you find a solution, you could post it here. |
🔎 Search Terms
Property 'fatal' does not exist on type 'Logger'
The problem
Custom
createLogger
logger with custom log levels receives aProperty 'fatal' does not exist on type 'Logger'
intellisense error forlogger.fatal
. All other log levels work just fine. Unfortunately, this is causingnpm run dev
to fail:What version of Winston presents the issue?
^3.8.1
What version of Node are you using?
v16.13.0
If this worked in a previous version of Winston, which was it?
N/A
Minimum Working Example
Additional information
No response
The text was updated successfully, but these errors were encountered: