Skip to content

shadlyd15/PrettyDebug

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Releases

No releases published

Packages

No packages published

Languages