Comments (9)
I do not know debug lib. Does it work without babel? You can configure es6 features and dont need transpiling https://github.com/s-a/iron-node/blob/master/docs/CONFIGURATION.md#v8-flags.
You could set a break point and debug what is going on at debug('init')('starting API');
from iron-node.
Updated my example above. Apparently it has nothing to do with babel.
from iron-node.
The v8 engine supports any official es6 feature. Since you are not using experimental stuff it might be more stable to debug without babel.
Never tried source maps but it should work as described at [https://developer.chrome.com/devtools/docs/javascript-debugging#using-source maps](https://developer.chrome.com/devtools/docs/javascript-debugging#using-source maps)
If you do not see any log output it definitely belogs to your debug methods. as you mentioned console.log('test') // this is called
works.
Have you debuged your log method?
from iron-node.
The v8 engine supports any official es6 feature. Since you are not using experimental stuff it might be more stable to debug without babel.
True, except for module imports/exports. But the sourcemaps work great so that's covered.
About the logging, I think I found the problem. Even though we're running in the browser, the logger still thinks it's a node environment, and I guess it's writing it to the stdout or another stream instead of the console.log.
https://github.com/visionmedia/debug/blob/master/example/stdout.js
I guess mongoose does the same.
It would be nice though if iron-node could bind the stdout to console.log, that way it is compatible with all logging systems.
from iron-node.
Just wanted to write you in #53 that iron-node is a hybrid environment while all scripts run always in a terminal console context. I dont know maybe you can include a browser version of debug.
from iron-node.
It would be nice though if iron-node could bind the stdout to console.log, that way it is compatible with all logging systems.
You can easy write your own Plugins for ironNode like this one.
https://github.com/s-a/iron-node-process-exit-break/blob/master/index.js. Let me know if you created something awesome
from iron-node.
Yep, apparently it's possible: https://github.com/visionmedia/debug/blob/master/example/stdout.js
Basically you just bind debug.log to console.log
I'll take a look at the plugins system. Thanks for the help!
from iron-node.
Still, I think adding this code in iron-node on startup would help more users because debug is used by a lot of people.
Do you agree?
This is the line to add:
debug.log = console.log.bind(console);
from iron-node.
We can do this only if debug was required. I suggest to write a simple package or extend the debug library directly. Maybe they accept a PR. It would make sense to discuss this behavior with the creators of debug because it impacts the electron environment.
from iron-node.
Related Issues (20)
- fails to stop on `debugger;` command HOT 4
- A dynamic link library (DLL) initialization routine failed (bcrypt) HOT 2
- iron-node not working with angular2-seed (typescript, gulp) HOT 1
- iron-node > 2.2.15 makes unicorns cry => doesn't work on OSX HOT 4
- Application takes 100% CPU and is unresponsive HOT 4
- Problem with using node-sass on Ubuntu 16.04 HOT 1
- command + w closes iron-node even when iron-node is behind another window HOT 1
- How to pass command to nodejs? HOT 1
- All good things come to an end.. HOT 4
- Publish a new version HOT 2
- new installation requieres install -g and still can't start HOT 7
- Run this in the web browser HOT 1
- No such module: atom_renderer_v8_util HOT 7
- Electron failed to install correctly, please delete node_modules/electron and try installing again HOT 5
- [feature request] Debugging without writing debugger HOT 4
- Electron Helper crashes when refreshing while devtools is paused HOT 4
- contextify.node was compiled against a different Node.js version using NODE_MODULE_VERSION 48 HOT 1
- Error: Cannot find module, despite NODE_PATH being set
- Usage with babel-node HOT 1
- Child Processes don't show in the logs or in the source
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 iron-node.