Comments (7)
That's not normally something you'd want to turn on and off?
from debug.
hmm -1 from me, I think errors should always be to stderr
from debug.
I'm inclined to say:
- Libraries should never log errors, under any circumstances. They can log other debugging info, but errors should be thrown (or passed to callbacks)
- Applications should never hide errors, under any circumstances. If there's an unhandled error in an application, it should always get logged to stderr, and has nothing to do with debugging settings.
from debug.
yeah in libs they should be emitted, but in your application etc you should delegate to something central for logging and output to stderr. Through the integration of whatever library into your application they should always reach there anyway so I dont think adding a bunch of if (err) debug(err) calls would help much
from debug.
Hmm, I totally agree with @ForbesLindesay's two points. It slipped my mind that debug
isn't always enabled, I just wanted a way to print an error and see which part of my app it came from.
I also think that there might be times when you want to print it under debug circumstances thought. I'm working on a small lib to easily build api servers and clients. On the server side you register all your functions which all can take a callback (which will be executed on the client). In the case of an error, you send it in as the first parameter of the callback. The error then gets serialized and sent over an socket to the client.
When debugging this it's very nice to be able to log the Error
object before sending it away to the client and forgetting about it.
In this case it would be really nice to have this feature.
from debug.
fair enough it'll be a tiny patch anyway
from debug.
Super, thanks!
from debug.
Related Issues (20)
- Security issue HOT 1
- Vuln: Inefficient regular expression complexity HOT 1
- debug with dotenv HOT 3
- INEFFICIENT REGULAR EXPRESSION COMPLEXITY IN DEBUG HOT 1
- [Question] How do I enable millisecond diff?
- Issue in Next.js HOT 5
- Redirect logs to file doesnt capture time HOT 2
- Different formatting for namespaces on TTY and files
- Specify peer dependency version
- Specify namespace with url in ESM HOT 5
- npm ERR! code ENOENT npm ERR! syscall open npm ERR! path C:\Users\sahar\Desktop\myCode\jonas_React_course\React_Jonas_20_10_2023\project_pizza-menu\package.json npm ERR! errno -4058 npm ERR! enoent Could not read package.json: Error: ENOENT: no such file or directory, open 'C:\Users\sahar\Desktop\myCode\jonas_React_course\React_Jonas_20_10_2023\project_pizza-menu\package.json' npm ERR! enoent This is related to npm not being able to find a file. npm ERR! enoent HOT 1
- Debug mixed with console.log HOT 6
- Debug Checkmarx Vulnerability HOT 1
- Avoid throwing errors
- useColors return false after modify user-agent in tauri app HOT 1
- Colour lost when using Node native test running (Node 18+) HOT 2
- Alternate solution to CWE-1333 | Inefficient Regular Expression Complexity
- Display full error object all the time regardless of argument position
- DEBUG_HIDE_DATE doesn't exist / do anything
- Property 'type' does not exist on type 'Process'.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from debug.