node-serialport-bindings-cpp/docs/guide-debugging.md
Francis Gulotta 4318c25383
docs: New docs system (#1647)
- remove old docs
- docusaurus docs
- guides
- api docs
- basic homepage
2018-09-09 05:12:19 -04:00

1 KiB

id title
guide-debugging Debugging

DEBUG=

We use the debug package and log under the serialport namespace. Each package has it's own scope

  • serialport/stream for all stream released logging
  • serialport/binding* for all binding related logging
  • serialport/* for everything

You can enable logging through environment variables. Check the debug docs for info.

DEBUG=serialport/main node myapp.js
DEBUG=serialport/* node myapp.js
DEBUG=* node myapp.js

Core dumps

You can enable core dumps on osx with;

ulimit -c unlimited for core dumps

You can "console.log" from c++ with;

fprintf(stdout, "Hellow World num=%d str=%s\n", 4, "hi");

Repl

You can make use of the serialport-repl command with;

serialport-repl # to auto detect an arduino
serialport-repl /path/name # to connect to a specific port

It will load a serialport object with debugging turned on.