OpenJAUS Software Development Kit  4.3.1
Classes | Namespaces | Macros | Functions
Logger.h File Reference
#include "openjaus/system/Event.h"
#include "openjaus/system/Thread.h"
#include <string>
#include "openjaus/types.h"
#include <ostream>
#include <sstream>

Classes

class  openjaus::system::Logger
 

Namespaces

 openjaus
 
 openjaus::system
 

Macros

#define OJ_FUNCTION   __FUNCTION__
 
#define OJ_LINE   __LINE__
 
#define OJ_LOG_PREAMBLE   "[" << OJ_FUNCTION << ":" << OJ_LINE << "]: "
 
#define LOG_OJ_DEBUG(msg)
 
#define LOG(msg)   LOG_VERBOSE(__FILE__,msg)
 
#define LOG_VERBOSE(logSpace, msg)
 
#define LOG_TO_FILE(file, msg)
 

Functions

std::string splitFileFromPath (std::string pathString)
 

Detailed Description

Copyright
Copyright (c) 2010-2016, OpenJAUS, LLC All rights reserved.

This file is part of the OpenJAUS Software Development Kit (SDK). This software is distributed under one of two licenses, the OpenJAUS SDK Commercial End User License Agreement or the OpenJAUS SDK Non-Commercial End User License Agreement. The appropriate licensing details were included in with your developer credentials and software download. See the LICENSE file included with this software for full details.

THIS SOFTWARE IS PROVIDED BY THE LICENSOR (OPENJAUS LCC) "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE LICENSOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. THE LICENSOR DOES NOT WARRANT THAT THE LICENSED SOFTWARE WILL MEET LICENSEE'S REQUIREMENTS OR THAT THE OPERATION OF THE LICENSED SOFTWARE WILL BE UNINTERRUPTED OR ERROR-FREE, OR THAT ERRORS IN THE LICENSED SOFTWARE WILL BE CORRECTED.

\ Software History

Macro Definition Documentation

§ LOG

#define LOG (   msg)    LOG_VERBOSE(__FILE__,msg)

§ LOG_OJ_DEBUG

#define LOG_OJ_DEBUG (   msg)

§ LOG_TO_FILE

#define LOG_TO_FILE (   file,
  msg 
)
Value:
{ \
std::ostringstream oss; \
static std::string __fileString; \
if(__fileString.empty()) \
{ \
__fileString = splitFileFromPath(__FILE__); \
} \
oss << "[" << time << "] " << __fileString << ":" << __LINE__ << " : " << msg; \
FILE *fp = fopen(file, "a"); \
if(fp) \
{ \
fputs(oss.str().c_str(), fp); \
fputs("\n", fp); \
fclose(fp); \
} \
}
This is a brief description.
Definition: Time.h:57
static Time getTime()
Operation getTime.
Definition: Time.cpp:120
std::string splitFileFromPath(std::string pathString)
Definition: Logger.h:77

§ LOG_VERBOSE

#define LOG_VERBOSE (   logSpace,
  msg 
)
Value:
{ \
using namespace openjaus::system; \
std::ostringstream oss; \
oss << msg; \
openjaus::system::Event evnt; \
evnt.setNameSpace(logSpace); \
evnt.setDescription(oss.str()); \
Logger::log(evnt); \
}
Definition: Accessable.cpp:45

§ OJ_FUNCTION

#define OJ_FUNCTION   __FUNCTION__

§ OJ_LINE

#define OJ_LINE   __LINE__

§ OJ_LOG_PREAMBLE

#define OJ_LOG_PREAMBLE   "[" << OJ_FUNCTION << ":" << OJ_LINE << "]: "

Function Documentation

§ splitFileFromPath()

std::string splitFileFromPath ( std::string  pathString)
inline