Bratmobile
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Logger Class Reference

Class used to load data from the configurator. More...

#include <debug.h>

Public Member Functions

 Logger (const char *new_folder, const char *_dir="/tmp", const char *customName="/stats")
 Construct a new Logger object. More...
 
bool log (const char *format,...)
 
const char * get_fileName ()
 

Static Public Member Functions

static const char * getSystemArchitecture ()
 Returns a string with system architecture.
 

Protected Member Functions

std::string file_dateTime (const char *custom, char name[80], const char *addOn=NULL)
 Creates filename name in format customdmy_hm.txt. More...
 
void init (const char *new_folder, const char *_dir=NULL, const char *customName="/stats")
 

Protected Attributes

char fileName [60]
 
FILE * f =NULL
 
int fileCount =0
 

Detailed Description

Class used to load data from the configurator.

Constructor & Destructor Documentation

◆ Logger()

Logger::Logger ( const char *  new_folder,
const char *  _dir = "/tmp",
const char *  customName = "/stats" 
)
inline

Construct a new Logger object.

Parameters
new_folderfolder where files will be dumped (no / at the end)
_dirdirectory containing new_folder
customNamefile prefix (/ must be at the beginning)

Member Function Documentation

◆ file_dateTime()

std::string Logger::file_dateTime ( const char *  custom,
char  name[80],
const char *  addOn = NULL 
)
protected

Creates filename name in format customdmy_hm.txt.

Parameters
customcustom
nameempty char array

◆ log()

bool Logger::log ( const char *  format,
  ... 
)
Parameters
formatprintf style e.g. "hello%s"
...other parameters

The documentation for this class was generated from the following files: