Skip to content

WestleyR/logger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple C Logger

This is a VERRY simple c message printer with color.

Install:

Install via clib:

$ clib install WestleyR/logger

Or add to your clib.json:

"dependencies": {
  "WestleyR/logger": "v1.1.0"
}

Be sure to check the latest release

Alternative install:

Copy the contents of the src directory to your project's src directory.

Example:

#include <stdio.h>

#include "logger/logger.h"

int main() {

    print_verbosef("You are not suppost to see this!\n");

    // 1 means on
    set_verbose(1);

    print_verbosef("You are suppested to see this!\n");

    print_errorf("This is a error message.\n");

    print_warningf("This is a warning message.\n");

    print_debugf("With debug off, you should *not* see this...\n");

    set_debug(1);

    print_debugf("With debug on, you should see this.\n");

    return(0);
}

Then add this flag to you Makefile: (only if you used clib to install, otherwise you compile as normal)

CFLAGS += -Ideps

License

The Clear BSD License

Copyright (c) 2019-2020 WestleyR
All rights reserved.

This software is licensed under a Clear BSD License.