项目作者: SergiuToporjinschi

项目描述 :
Line logger
高级语言: Python
项目地址: git://github.com/SergiuToporjinschi/SketchLogger.git
创建时间: 2019-09-29T07:29:20Z
项目社区:https://github.com/SergiuToporjinschi/SketchLogger

开源协议:GNU General Public License v3.0

下载


GitHub repo size in bytes
GitHub last commit
GitHub stars
GitHub watchers
GitHub license
Code Climate
Build Status

Sketch Logger

Logging system for sketches

Dependency

  • none

    Macros

  • DEBUGGER if defined, will output the text which calls DBGLN;
  • DEBUGGER_SHORT_FILENAME if defined, the file path will be replaced with just the file name;

    Examples

    Using debugger in a lib can be used just by including debug_macro.h in cpp file
    Setting the debugger in main file
  1. #include "debug_macro.h" //Include macros
  2. #ifdef DEBUGGER
  3. Print *dbg = &Serial; // we need to define this as global to be used by debug name space
  4. #endif
  5. void setup() {
  6. Serial.begin(74880); //initialize serial
  7. dbg = &Serial; //assign serial to dbg variable
  8. char x = 't';
  9. DBGLN("test: %c", x); //src\main.cpp(32): test: t
  10. }
  11. void loop() {
  12. delay(1000);
  13. DBGLN("debug Line"); //src\main.cpp(37): debug Line
  14. }