Files
NazaraEngine/include/Nazara/Core/Log.hpp
Lynix dd4cb97a37 Added support for OpenGL debug mode
When NzContextParameters.debugMode is true, Nazara will receive OpenGL's
debug message and send them to Nazara's log
NzString::Pointer now have the "0x" prefix
Added support for ARB_texture_storage extension
Nazara now try to load core texture 3D before trying to load
EXT_texture3D
Added NazaraNotice macro, writing raw text into Nazara's log
Added NzContext::Destroy (called in Create)
2012-05-31 23:33:47 +02:00

57 lines
1.2 KiB
C++

// Copyright (C) 2012 Jérôme Leclercq
// This file is part of the "Nazara Engine".
// For conditions of distribution and use, see copyright notice in Config.hpp
#pragma once
#ifndef NAZARA_LOG_HPP
#define NAZARA_LOG_HPP
#include <Nazara/Prerequesites.hpp>
#include <Nazara/Core/Error.hpp>
#include <Nazara/Core/NonCopyable.hpp>
#include <Nazara/Core/String.hpp>
#define NAZARA_CLASS_LOG
#include <Nazara/Core/ThreadSafety.hpp>
#define NazaraLog NzLog::Instance()
#define NazaraNotice(txt) NazaraLog->Write(txt)
class NzFile;
class NAZARA_API NzLog : NzNonCopyable
{
public:
void Enable(bool enable);
void EnableAppend(bool enable);
void EnableDateTime(bool enable);
NzString GetFile() const;
bool IsEnabled() const;
void SetFile(const NzString& filePath);
void Write(const NzString& string);
void WriteError(nzErrorType type, const NzString& error, unsigned int line, const NzString& file, const NzString& func);
static NzLog* Instance();
private:
NzLog();
~NzLog();
NazaraMutexAttrib(m_mutex, mutable)
NzString m_filePath;
NzFile* m_file;
bool m_append;
bool m_enabled;
bool m_writeTime;
};
#undef NAZARA_CLASS_LOG
#endif // NAZARA_LOGGER_HPP