Jack Hansdampf / mbed-mqtt-GSOE1

Dependents:   ESP8266MQTT

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers MQTTSNGWLogmonitor.cpp Source File

MQTTSNGWLogmonitor.cpp

00001 /**************************************************************************************
00002  * Copyright (c) 2016, Tomoaki Yamaguchi
00003  *
00004  * All rights reserved. This program and the accompanying materials
00005  * are made available under the terms of the Eclipse Public License v1.0
00006  * and Eclipse Distribution License v1.0 which accompany this distribution.
00007  *
00008  * The Eclipse Public License is available at
00009  *    http://www.eclipse.org/legal/epl-v10.html
00010  * and the Eclipse Distribution License is available at
00011  *   http://www.eclipse.org/org/documents/edl-v10.php.
00012  *
00013  * Contributors:
00014  *    Tomoaki Yamaguchi - initial API and implementation and/or initial documentation
00015  **************************************************************************************/
00016 #define RINGBUFFER
00017 
00018 #include "MQTTSNGWProcess.h"
00019 #include "MQTTSNGWLogmonitor.h"
00020 #include <stdio.h>
00021 
00022 using namespace std;
00023 using namespace MQTTSNGW;
00024 
00025 Logmonitor::Logmonitor()
00026 {
00027     theProcess = this;
00028 }
00029 
00030 Logmonitor::~Logmonitor()
00031 {
00032 
00033 }
00034 
00035 void Logmonitor::run()
00036 {
00037     while (true)
00038     {
00039         const char* data = getLog();
00040         if ( *data == 0 )
00041         {
00042             break;
00043         }
00044         else
00045         {
00046             printf("%s", data);
00047         }
00048     }
00049 }
00050