Giter VIP home page Giter VIP logo

prettydebug's Introduction

PrettyDebug

A lightweight debug library written in C/C++. It is designed especially for embedded systems keeping in mind the limitation and capabilities of the platform.

  • Low memory usage
  • Supports a wide range of compilers and processor architectures
  • Arduino compatible
  • ESP32 & ESP8266 supported
  • Color debug output
  • Very easy to use

How to use

  • Attach Debug Stream :
	ATTACH_DEBUG_STREAM(&Serial);
  • Print Green OK Message :
	DEBUG_OK("An Example OK Message From %s, "PrettyDebug");
  • Print Red ERROR Message :
	DEBUG_ERROR("An Example ERROR Message From %s, "PrettyDebug");
  • Print Red ERROR Message :
	DEBUG_ERROR("An Example ERROR Message From %s, "PrettyDebug");
  • Print Cyan ALERT Message :
	DEBUG_ALERT("An Example ALERT Message From %s, "PrettyDebug");
  • Print Yellow WARNING Message :
	DEBUG_WARNING("An Example WARNING Message From %s, "PrettyDebug");
  • Print Variable with Variable Name :
	DEBUG_VARIABLE("%d", Sample_Value);
  • Print Array with Name :
	DEBUG_ARRAY(Sample_Array, 16, "%02X");

Print Current Location in Code :

	DEBUG_TRACE();

Arduino Example

	#include "PrettyDebug.h"

	int Sample_Variable = 123;
	int Sample_Array[] = {1, 2, 3, 4, 5};

	void setup(){
	    Serial.begin(115200);
	    ATTACH_DEBUG_STREAM(&Serial);

	    DEBUG_OK("Pretty Debug Example Sketch");
	    DEBUG_TRACE();

	    DEBUG_OK("An Example OK Message From %s, "PrettyDebug");
	    DEBUG_ERROR("An Example ERROR Message From %s, "PrettyDebug");
	    DEBUG_ERROR("An Example ERROR Message From %s, "PrettyDebug");
	    DEBUG_ALERT("An Example ALERT Message From %s, "PrettyDebug");
	    DEBUG_WARNING("An Example WARNING Message From %s, "PrettyDebug");
	    DEBUG_VALUE(Sample_Value, "%d");
	    DEBUG_ARRAY(Sample_Array, 5, "%02X");
	}

	void loop(){

	}

Sample Output

Sample Output

prettydebug's People

Contributors

shadlyd15 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

imran-tns

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.