GithubHelp home page GithubHelp logo

anonymous-qsh / colorwheel Goto Github PK

View Code? Open in Web Editor NEW

This project forked from totoditoto/colorwheel

0.0 0.0 0.0 56 KB

Colorwheel provides easy-to-use colored print and trace macros for debuging your C program.

Shell 4.30% C 95.70%

colorwheel's Introduction

colorwheel

Colorwheel provides easy-to-use colored print and trace macros for debuging your C or C++ program.

Example screenshotย 

To install directly to your include path, run the following command :

sudo wget -O /usr/include/colorwheel.h https://raw.githubusercontent.com/Totoditoto/colorwheel/master/colorwheel.h

Then include to your project using :

#include <colorwheel.h>

Macros

Here are the ready-to-use macros :

/* Predefined printf styled messages */
CW_PRINT_NORMAL(message, ...);
CW_PRINT_ALARM(message, ...);
CW_PRINT_CRITICAL(message, ...);
CW_PRINT_FAULT(message, ...);
CW_PRINT_VALID(message, ...);
CW_PRINT_INFO(message, ...);

/* Predefined trace styled messages (indicates file, function and line) */
CW_TRACE_NORMAL(message, ...);
CW_TRACE_ALARM(message, ...);
CW_TRACE_CRITICAL(message, ...);
CW_TRACE_FAULT(message, ...);
CW_TRACE_VALID(message, ...);
CW_TRACE_INFO(message, ...);

Example

Here's a little test program showing all predefined message styles :

#include <colorwheel.h>

static int value = 10;

static void end_of_everything(void)
{
    CW_TRACE_CRITICAL("It was way worse than expected! Computer will explode in %d s", value);
    CW_TRACE_ALARM("IT IS TOO LATE RUN AWAY");
}

void main(void)
{
    CW_TRACE_NORMAL("This is a normal information");
    CW_TRACE_INFO("This is a noticeable information");
    CW_TRACE_FAULT("Ooops something might have gone wrong");
    CW_TRACE_VALID("Finally it's okay, don't worry");
    CW_TRACE_NORMAL("Nevermind");
    end_of_everything();
}

colorwheel's People

Contributors

totoditoto avatar

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.