Skip to content

Commit 93091e8

Browse files
author
전상현
committed
[100_System] 시스템 함수 호출 중에 발생하는 에러는 Debug 로그로 남기도록 변경함(불필요하게 많은 오류가 로그에 남음)
1 parent fd19cc9 commit 93091e8

20 files changed

+118
-118
lines changed

Src/100_System/EnvironmentT.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ namespace core
1515
ECODE dwRet = ParseTZFile(MBSFromTCS(pszFilePath).c_str(), stTZInfo);
1616
if( EC_SUCCESS != dwRet )
1717
{
18-
Log_Error("GetTimeZoneInformation calling failure");
18+
Log_Debug("GetTimeZoneInformation calling failure");
1919
return TIME_ZONE_ID_INVALID_;
2020
}
2121

Src/100_System/EnvironmentT_Win.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ namespace core
2222
TCHAR szBuf[tBufSize] = { 0, };
2323
if( 0 == ::FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, 0, nCode, 0, szBuf, tBufSize, NULL) )
2424
{
25-
Log_Error("FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, ... %u) calling failure, %u", nCode, ::GetLastError());
25+
Log_Debug("FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, ... %u) calling failure, %u", nCode, ::GetLastError());
2626
return Format(TEXT("Error Code:%u"), nCode);
2727
}
2828

@@ -47,7 +47,7 @@ namespace core
4747
return strName;
4848
}
4949

50-
Log_Error("GetUserName calling failure");
50+
Log_Debug("GetUserName calling failure");
5151
return TEXT("");
5252
}
5353

@@ -59,7 +59,7 @@ namespace core
5959

6060
if( FALSE == ::GetComputerName(szName, &dwCchLen) )
6161
{
62-
Log_Error("GetComputerName calling failure");
62+
Log_Debug("GetComputerName calling failure");
6363
return TEXT("");
6464
}
6565

@@ -130,7 +130,7 @@ namespace core
130130
}
131131
catch (std::exception& e)
132132
{
133-
//Log_Error("%s", e.what());
133+
//Log_Debug("%s", e.what());
134134
return nRet;
135135
}
136136
}
@@ -172,7 +172,7 @@ namespace core
172172
}
173173
catch (std::exception& e)
174174
{
175-
//Log_Error("%s", e.what());
175+
//Log_Debug("%s", e.what());
176176
return nRet;
177177
}
178178
}
@@ -228,7 +228,7 @@ namespace core
228228
DWORD dwRet = ::GetTimeZoneInformation(&stTemp);
229229
if( TIME_ZONE_ID_INVALID == dwRet )
230230
{
231-
Log_Error("GetTimeZoneInformation calling failure");
231+
Log_Debug("GetTimeZoneInformation calling failure");
232232
return TIME_ZONE_ID_INVALID_;
233233
}
234234

Src/100_System/Environment_Win.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ namespace core
221221
}
222222
catch (std::exception& e)
223223
{
224-
Log_Error("%s", e.what());
224+
Log_Debug("%s", e.what());
225225
}
226226
return OS_TYPE_UNDEFINED;
227227
}

Src/100_System/FileSystemT_Linux_Mac.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ namespace core
104104
}
105105
catch( std::exception& e )
106106
{
107-
Log_Error("%s", e.what());
107+
Log_Debug("%s", e.what());
108108

109109
if( pInFile )
110110
fclose(pInFile);
@@ -135,7 +135,7 @@ namespace core
135135
{
136136
if( ::unlink(MBSFromTCS(pszFileName).c_str()) < 0 )
137137
{
138-
Log_Error(TEXT("unlink(%s) failure, %d"), pszFileName, errno);
138+
Log_Debug(TEXT("unlink(%s) failure, %d"), pszFileName, errno);
139139
return false;
140140
}
141141

@@ -149,7 +149,7 @@ namespace core
149149
{
150150
if( errno != EEXIST )
151151
{
152-
Log_Error(TEXT("mkdir(%s) failure, %d"), pszPath, errno);
152+
Log_Debug(TEXT("mkdir(%s) failure, %d"), pszPath, errno);
153153
return false;
154154
}
155155

@@ -164,7 +164,7 @@ namespace core
164164
{
165165
if( ::rmdir(MBSFromTCS(pszPath).c_str()) < 0 )
166166
{
167-
Log_Error(TEXT("rmdir(%s) failure, %d"), pszPath, errno);
167+
Log_Debug(TEXT("rmdir(%s) failure, %d"), pszPath, errno);
168168
return false;
169169
}
170170
return true;
@@ -175,7 +175,7 @@ namespace core
175175
{
176176
if( 0 == ::link(MBSFromTCS(pszTargetFilename).c_str(), MBSFromTCS(pszSymlinkFilename).c_str()) )
177177
return true;
178-
Log_Error("link failure, %d(%s)", errno, strerror(errno));
178+
Log_Debug("link failure, %d(%s)", errno, strerror(errno));
179179
return false;
180180
}
181181

@@ -192,7 +192,7 @@ namespace core
192192
std::string strTmp = Format("/proc/%d/exe", ::getpid());
193193
char szPath[1024] = { 0x00, };
194194
if( ::readlink(strTmp.c_str(), szPath, 1024) < 0 )
195-
Log_Error("readlink(%s) failure, %d", strTmp.c_str(), errno);
195+
Log_Debug("readlink(%s) failure, %d", strTmp.c_str(), errno);
196196
return TCSFromMBS(szPath);
197197
#endif
198198
}
@@ -206,7 +206,7 @@ namespace core
206206
Dl_info stModuleInfo;
207207
if( 0 == ::dladdr(hModule, &stModuleInfo) )
208208
{
209-
Log_Error("dladdr calling failure, hModule=0x%X", hModule);
209+
Log_Debug("dladdr calling failure, hModule=0x%X", hModule);
210210
return TEXT("");
211211
}
212212

@@ -219,7 +219,7 @@ namespace core
219219
char* pszCWD = ::getcwd(NULL, 0);
220220
if( NULL == pszCWD )
221221
{
222-
Log_Error("getcwd failure, %d", errno);
222+
Log_Debug("getcwd failure, %d", errno);
223223
return TEXT("");
224224
}
225225

@@ -234,7 +234,7 @@ namespace core
234234
std::string strNewPathA = MBSFromTCS(pszNewPath);
235235
if( ::chdir(strNewPathA.c_str()) < 0 )
236236
{
237-
Log_Error("chdir(%s) failure, %s", strNewPathA.c_str(), strerror(errno));
237+
Log_Debug("chdir(%s) failure, %s", strNewPathA.c_str(), strerror(errno));
238238
return false;
239239
}
240240
return true;
@@ -254,14 +254,14 @@ namespace core
254254
struct stat stStat = { 0, };
255255
if( ::stat(strFilePath.c_str(), &stStat) < 0 )
256256
{
257-
Log_Error("::stat(%s) has failed, %s", strFilePath.c_str(), strerror(errno));
257+
Log_Debug("::stat(%s) has failed, %s", strFilePath.c_str(), strerror(errno));
258258
continue;
259259
}
260260

261261
if( S_ISLNK(stStat.st_mode) )
262262
{
263263
if( ::lstat(strFilePath.c_str(), &stStat) < 0 )
264-
Log_Error("::lstat(%s) has failed, %s", strFilePath.c_str(), strerror(errno));
264+
Log_Debug("::lstat(%s) has failed, %s", strFilePath.c_str(), strerror(errno));
265265
}
266266

267267
pFindData->bIsDirectory = S_ISDIR(stStat.st_mode);
@@ -287,7 +287,7 @@ namespace core
287287
DIR* pDir = ::opendir(strCurPath.c_str());
288288
if( NULL == pDir )
289289
{
290-
Log_Error("opendir(%s) operation failure, %s", strCurPath.c_str(), strerror(errno));
290+
Log_Debug("opendir(%s) operation failure, %s", strCurPath.c_str(), strerror(errno));
291291
return NULL;
292292
}
293293

Src/100_System/FileSystemT_Win.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ namespace core
2626
errno_t tRet = tfopen_s(&pFile, pszPath, pszMode);
2727
if( 0 != tRet )
2828
{
29-
Log_Error(TEXT("_tfopen_s(%s, %s) failure, %u"), pszPath, pszMode, tRet);
29+
Log_Debug(TEXT("_tfopen_s(%s, %s) failure, %u"), pszPath, pszMode, tRet);
3030
return NULL;
3131
}
3232

@@ -41,7 +41,7 @@ namespace core
4141
UINT uRet = ::GetSystemDirectory(szBuff, tBuffSize);
4242
if( 0 == uRet )
4343
{
44-
Log_Error("GetSystemDirectory calling failure, %u", ::GetLastError());
44+
Log_Debug("GetSystemDirectory calling failure, %u", ::GetLastError());
4545
return TEXT("C:\\");
4646
}
4747

@@ -56,7 +56,7 @@ namespace core
5656
UINT uRet = ::GetTempPath(tBuffSize, szBuff);
5757
if( 0 == uRet )
5858
{
59-
Log_Error("GetTempPath calling failure, %u", ::GetLastError());
59+
Log_Debug("GetTempPath calling failure, %u", ::GetLastError());
6060
return TEXT("%TEMP%");
6161
}
6262

@@ -79,7 +79,7 @@ namespace core
7979
#endif
8080
if( INVALID_FILE_ATTRIBUTES == dwRet )
8181
{
82-
Log_Error("GetFileAttributes(%s) returned INVALID_FILE_ATTRIBUTES", pszPath);
82+
Log_Debug("GetFileAttributes(%s) returned INVALID_FILE_ATTRIBUTES", pszPath);
8383
return false;
8484
}
8585

@@ -161,7 +161,7 @@ std::tstring GetFileName(void)
161161
dwWrittenLen = ::GetModuleFileName(NULL, (TCHAR*)strRet.c_str(), dwLength);
162162
if( 0 == dwWrittenLen )
163163
{
164-
Log_Error("GetModuleFileName calling faliure, %u", ::GetLastError());
164+
Log_Debug("GetModuleFileName calling faliure, %u", ::GetLastError());
165165
return TEXT("");
166166
}
167167
} while(ERROR_INSUFFICIENT_BUFFER == ::GetLastError());
@@ -185,7 +185,7 @@ std::tstring GetModuleFileName(HANDLE hModule)
185185
dwWrittenLen = ::GetModuleFileName((HINSTANCE)hModule, (TCHAR*)strRet.c_str(), dwLength);
186186
if( 0 == dwWrittenLen )
187187
{
188-
Log_Error("GetModuleFileName faliure, %u", ::GetLastError());
188+
Log_Debug("GetModuleFileName faliure, %u", ::GetLastError());
189189
return TEXT("");
190190
}
191191
} while(ERROR_INSUFFICIENT_BUFFER == ::GetLastError());
@@ -201,7 +201,7 @@ std::tstring GetModuleFileName(HANDLE hModule)
201201
DWORD dwRet = ::GetCurrentDirectory(1024, szBuff);
202202
if( 0 == dwRet )
203203
{
204-
Log_Error("GetCurrentDirectroy failure, %u", ::GetLastError());
204+
Log_Debug("GetCurrentDirectroy failure, %u", ::GetLastError());
205205
return TEXT("");
206206
}
207207

@@ -213,7 +213,7 @@ std::tstring GetModuleFileName(HANDLE hModule)
213213
{
214214
if( !::SetCurrentDirectory(pszNewPath) )
215215
{
216-
Log_Error("SetCurrentDirectory calling failure, %u", ::GetLastError());
216+
Log_Debug("SetCurrentDirectory calling failure, %u", ::GetLastError());
217217
return false;
218218
}
219219
return true;

Src/100_System/GlobalSemaphoreMap.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ namespace core
142142
_ST_SEM_DATA* pSemData = FindSemData(pHandleData->szName);
143143
if( NULL == pSemData )
144144
{
145-
Log_Error("Sem data called [%s] is not found.", pHandleData->szName);
145+
Log_Debug("Sem data called [%s] is not found.", pHandleData->szName);
146146
break;
147147
}
148148

@@ -167,7 +167,7 @@ namespace core
167167
_ST_SEM_DATA* pSemData = FindSemData(pHandleData->szName);
168168
if( NULL == pSemData )
169169
{
170-
Log_Error("Sem data called [%s] is not found.", pHandleData->szName);
170+
Log_Debug("Sem data called [%s] is not found.", pHandleData->szName);
171171
return;
172172
}
173173

@@ -183,7 +183,7 @@ namespace core
183183
_ST_SEM_DATA* pSemData = FindSemData(pHandleData->szName);
184184
if( NULL == pSemData )
185185
{
186-
Log_Error("Sem data called [%s] is not found.", pHandleData->szName);
186+
Log_Debug("Sem data called [%s] is not found.", pHandleData->szName);
187187
return;
188188
}
189189

@@ -199,7 +199,7 @@ namespace core
199199
_ST_SEM_DATA* pSemData = FindSemData(pHandleData->szName);
200200
if( NULL == pSemData )
201201
{
202-
Log_Error("Sem data called [%s] is not found.", pHandleData->szName);
202+
Log_Debug("Sem data called [%s] is not found.", pHandleData->szName);
203203
return false;
204204
}
205205

Src/100_System/Information.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ namespace core
113113
DWORD dwValue = DWORDFrom(strToken);
114114
if( dwValue > 0xFF )
115115
{
116-
Log_Error(TEXT("IP address %dth token exceed 0xFF in %s"), i+1, pszIP);
116+
Log_Debug(TEXT("IP address %dth token exceed 0xFF in %s"), i+1, pszIP);
117117
SetLastError(EC_INVALID_IP_STRING);
118118
return 0;
119119
}
@@ -122,7 +122,7 @@ namespace core
122122

123123
if( (i != 4) || (nOffset > 0) )
124124
{
125-
Log_Error(TEXT("Invalid IP address token count, %s"), pszIP);
125+
Log_Debug(TEXT("Invalid IP address token count, %s"), pszIP);
126126
SetLastError(EC_INVALID_IP_STRING);
127127
return 0;
128128
}

0 commit comments

Comments
 (0)