summaryrefslogtreecommitdiffstats
path: root/src/Log.cpp
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2014-07-22 11:24:28 +0200
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2014-07-22 11:24:28 +0200
commit3385ed56b86a7816892e199fdda177ebb3a33966 (patch)
treee4ebda8e1fc245e9a84c3c4b363c05bbbad3a85f /src/Log.cpp
parentSuggestions (diff)
parentUpdated prefabs to current Gallery content. (diff)
downloadcuberite-3385ed56b86a7816892e199fdda177ebb3a33966.tar
cuberite-3385ed56b86a7816892e199fdda177ebb3a33966.tar.gz
cuberite-3385ed56b86a7816892e199fdda177ebb3a33966.tar.bz2
cuberite-3385ed56b86a7816892e199fdda177ebb3a33966.tar.lz
cuberite-3385ed56b86a7816892e199fdda177ebb3a33966.tar.xz
cuberite-3385ed56b86a7816892e199fdda177ebb3a33966.tar.zst
cuberite-3385ed56b86a7816892e199fdda177ebb3a33966.zip
Diffstat (limited to '')
-rw-r--r--src/Log.cpp32
1 files changed, 16 insertions, 16 deletions
diff --git a/src/Log.cpp b/src/Log.cpp
index d96e3e9e4..7686a0fb4 100644
--- a/src/Log.cpp
+++ b/src/Log.cpp
@@ -17,7 +17,7 @@
cLog* cLog::s_Log = NULL;
-cLog::cLog(const AString & a_FileName )
+cLog::cLog(const AString & a_FileName)
: m_File(NULL)
{
s_Log = this;
@@ -25,7 +25,7 @@ cLog::cLog(const AString & a_FileName )
// create logs directory
cFile::CreateFolder(FILE_IO_PREFIX + AString("logs"));
- OpenLog((FILE_IO_PREFIX + AString("logs/") + a_FileName).c_str() );
+ OpenLog((FILE_IO_PREFIX + AString("logs/") + a_FileName).c_str());
}
@@ -59,7 +59,7 @@ cLog * cLog::GetInstance()
void cLog::CloseLog()
{
- if( m_File )
+ if (m_File)
fclose (m_File);
m_File = 0;
}
@@ -68,13 +68,13 @@ void cLog::CloseLog()
-void cLog::OpenLog( const char* a_FileName )
+void cLog::OpenLog( const char* a_FileName)
{
- if(m_File) fclose (m_File);
+ if (m_File) fclose (m_File);
#ifdef _MSC_VER
- fopen_s( &m_File, a_FileName, "a+" );
+ fopen_s( &m_File, a_FileName, "a+");
#else
- m_File = fopen(a_FileName, "a+" );
+ m_File = fopen(a_FileName, "a+");
#endif
}
@@ -85,11 +85,11 @@ void cLog::OpenLog( const char* a_FileName )
void cLog::ClearLog()
{
#ifdef _MSC_VER
- if( fopen_s( &m_File, "log.txt", "w" ) == 0)
+ if (fopen_s( &m_File, "log.txt", "w") == 0)
fclose (m_File);
#else
- m_File = fopen("log.txt", "w" );
- if( m_File )
+ m_File = fopen("log.txt", "w");
+ if (m_File)
fclose (m_File);
#endif
m_File = NULL;
@@ -105,15 +105,15 @@ void cLog::Log(const char * a_Format, va_list argList)
AppendVPrintf(Message, a_Format, argList);
time_t rawtime;
- time ( &rawtime );
+ time ( &rawtime);
struct tm* timeinfo;
#ifdef _MSC_VER
struct tm timeinforeal;
timeinfo = &timeinforeal;
- localtime_s(timeinfo, &rawtime );
+ localtime_s(timeinfo, &rawtime);
#else
- timeinfo = localtime( &rawtime );
+ timeinfo = localtime( &rawtime);
#endif
AString Line;
@@ -130,9 +130,9 @@ void cLog::Log(const char * a_Format, va_list argList)
// Print to console:
#if defined(ANDROID_NDK)
- // __android_log_vprint(ANDROID_LOG_ERROR,"MCServer", a_Format, argList);
- __android_log_print(ANDROID_LOG_ERROR, "MCServer", "%s", Line.c_str() );
- // CallJavaFunction_Void_String(g_JavaThread, "AddToLog", Line );
+ // __android_log_vprint(ANDROID_LOG_ERROR, "MCServer", a_Format, argList);
+ __android_log_print(ANDROID_LOG_ERROR, "MCServer", "%s", Line.c_str());
+ // CallJavaFunction_Void_String(g_JavaThread, "AddToLog", Line);
#else
printf("%s", Line.c_str());
#endif