Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: EthernetInterfacePlusHostname NTPClient Onewire RdWebServer SDFileSystem-RTOS mbed-rtos mbed-src
Logger.h
- Committer:
- Bobty
- Date:
- 2015-10-16
- Revision:
- 22:14b4060dd027
- Parent:
- 20:7933076df5af
File content as of revision 22:14b4060dd027:
// Log to SD
// Rob Dobson, 2015
#ifndef __LOGGER__H
#define __LOGGER__H
#include "mbed.h"
#include <stdarg.h>
#include "rtos.h"
class Logger
{
public:
Logger(const char* eventLogFileName, const char* dataLogFileBase, Mutex &sdCardMutex);
void LogEvent(const char* format, ...);
void LogData(const char* format, ...);
void LogDebug(const char* format, ...);
void SetDebugDest(bool logToFile, bool logToConsole)
{
_logDebugToFile = logToFile;
_logDebugToConsole = logToConsole;
};
private:
const char* _eventLogFileName;
const char* _dataLogFileBase;
bool _logDebugToFile;
bool _logDebugToConsole;
Mutex &_sdCardMutex;
};
#endif