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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
log.error() will throw following exception #26
Comments
Hi Jordy, This is a new one to me. Can you tell me what node version you are running and supply some sample code? Also, try running the examples to see if they run ok. thanks, darryl |
Im getting the same error . My node version is 8.9.4 |
I'm not able to reproduce so can you send me a snippet of code that breaks? |
Same for me on node 8.11.1:
|
This is a problem on Windows. To fix it, replace the line 45 of Logger.js by this one:
I created a PR #31 |
@bioleyl Thanks for the fix! Its a problem on macOS as well. |
FYI I am having the problem on Ubuntu 18.04 / Node v8.10.0 Thanks for the fix |
There is not much activity on the sources. |
This solves the problem but it no make sense because String is not a possible output for typeof(). Putting if (level === 'error' && typeof(errorEventName) === String) { is exactly the same as putting: if (false) { |
I experience this behavior even with the latest version (18.12.21) that should have the commit that fixed the issue. Is it correct? |
hi Mark, are you on Windows? I haven't been able to reproduce this error on mac or linux but I don't have a windows env to test. I guess I should create a windows docker image to see if I can reproduce. |
Yes, Windows 7 64-bit. |
I am on Ubuntu 18.10 with Node 8.11.4 and Edit: The exact error message is:
|
because this line: "errorEventName:'error' " - throw error in node. remove this line from your "simple-node-looger" config object and the error will not show anymore. |
@benivalotker I know this is almost a year later, but this is the fix that worked for me. Thank you! I was having this issue using |
Fixed it!
|
The problem is still not fixed as I see:
It disappears if I remove this line from options |
After lots of struggle, finally, I simply followed the examples and got it working.
|
The same error here:
What's the meaning of the code guarded by conditions? Based on previous comments and my case It looks like lines 45-47 could be removed completely... |
Running into the same bug, couldn't figure out for the life of me where the exception was coming from, until I replaced ".error()" with ".info()" and voila, the exception disappeared. The exception I get is identical to the one @awps posted. What's more baffling is that there are other sections of the program where .error() works just fine. Node: v16.9.1 Since this program has a lot of async functions in it, I'm thinking maybe the problem stems from something related to async? I don't know really. I haven't been able to produce a minimal example of the bug nor can I show you the real source code since it's proprietary. |
Hi,
I just start to use simple-node-logger. When I use "log.error()", I will get this exception. Do you know what I have done incorrectly? It runs ok with log.debug or log.info, etc 馃槃
Would you point me right direction? Thanks!
=============================================
events.js:188
throw err;
^
Error: Unhandled "error" event. ([object Object])
at process.emit (events.js:186:19)
at D:\DEV\nodejs_projects\SystemMonitors\node_modules\simple-node-logger\lib\Logger.js:46:25
at _combinedTickCallback (internal/process/next_tick.js:131:7)
at process._tickCallback (internal/process/next_tick.js:180:9)
The text was updated successfully, but these errors were encountered: