Helpful logging and error format

Dependents:   Waldo_Embed_V2

Embed: (wiki syntax)

« Back to documentation index

LogUtil Class Reference

LogUtil Class Reference

Using the LogUtil class. More...

#include <LogUtil.h>

Public Member Functions

 LogUtil (BufferedSerial &serial, uint32_t baudrate=0)
 Construct the LogUtil class and configure.

Detailed Description

Using the LogUtil class.

Example:

  #include "mbed.h"
  #include "LogUtil.h"
  
  LogUtil logger;

  int main()
  {
     LOG("This is a log\n");
     WARN("This is a warning\n");

     for(int i=0; i<3; ++i) {
         LOG("Log message #%d\n", i);
     }

     for(int i=0; i<3; ++i) {
         WARN("Warn message #%d\n", i);
     }

     ERROR("This is an error\n");
  }

Different ways to log messages having a standard interface

Definition at line 76 of file LogUtil.h.


Constructor & Destructor Documentation

LogUtil ( BufferedSerial &  serial,
uint32_t  baudrate = 0 
)

Construct the LogUtil class and configure.

Definition at line 26 of file LogUtil.cpp.