CoffeePi
Coffee machine control for Raspberry Pi
Functions | Variables
logger.cpp File Reference
#include <stdio.h>
#include <stdarg.h>
#include <time.h>
#include "global.h"
#include "logger.h"

Functions

void logger_print_time (_IO_FILE *stream)
 Prints a timestamp. More...
 
void logger_error (const char *format,...)
 Outputs the printf like formatted message to stderr and colorizes it. More...
 
void logger_reset ()
 Resets the logger to prevent the previous line being overdrawn. More...
 
void logger (logger_verbose_t verboselevel, logger_type_t logtype, const char *format,...)
 prints the message to stdout and formats it More...
 
void logger (logger_verbose_t verboselevel, const char *format,...)
 prints the message to stdout More...
 

Variables

int lastlog = 0
 

Function Documentation

void logger ( logger_verbose_t  verboselevel,
logger_type_t  logtype,
const char *  format,
  ... 
)

prints the message to stdout and formats it

Parameters
verboselevelminimum verbose level for output
logtypetype of logmessage for coloring
formatprintf formatted string
void logger ( logger_verbose_t  verboselevel,
const char *  format,
  ... 
)

prints the message to stdout

Parameters
verboselevelminimum verbose level for output
formatprintf formatted string
void logger_error ( const char *  format,
  ... 
)

Outputs the printf like formatted message to stderr and colorizes it.

Parameters
formatprintf formatted string
void logger_print_time ( _IO_FILE *  stream)

Prints a timestamp.

Parameters
streamtarget stream (stdout, stderr)
void logger_reset ( )

Resets the logger to prevent the previous line being overdrawn.

Call after custom printf

Variable Documentation

int lastlog = 0