DaemonLog.cpp
资源名称:warftpd.zip [点击查看]
上传用户:surprise9
上传日期:2007-01-04
资源大小:426k
文件大小:2k
源码类别:
Ftp客户端
开发平台:
Visual C++
- // This is part of the WAR SOFTWARE SERIES initiated by Jarle Aase
- // Copyright 1996 by Jarle Aase. All rights reserved.
- // See the "War Software Series Lisence Agreement" for details concerning
- // use and distribution.
- // ---
- // This source code, executables and programs containing source code or
- // binaries or proprietetary technology from the War Software Series are
- // NOT alloed used, viewed or tested by any governmental agencies in
- // any countries. This includes the government, departments, police,
- // military etc.
- // ---
- // This file is intended for use with Tab space = 2
- // Created and maintained in MSVC Developer Studio
- // ---
- // NAME : DaemonLog.cpp
- // PURPOSE :
- // PROGRAM : War FTP Daemon
- // DATE : Sept. 23 1996
- // AUTHOR : Jarle Aase
- // ---
- // NOTE : All class names start with CFTPD
- // ---
- // REVISION HISTORY
- //
- #include "stdafx.h"
- #include "WarDaemon.h"
- #include "ServerDlg.h"
- #include "WarService.h"
- #include "eventlogmsgs.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // class CDaemonLog
- // Derived class of CLog to support logging to console
- // New lines are added at bottom. If the last line is current
- // the display scrolls. Else it tries to keep the selection
- // visible.
- // When max number of lines is reached, it deletes the first line.
- CDaemonLog::CDaemonLog()
- {
- m_LogWin = NULL;
- }
- void CDaemonLog::LoggedLine(int LogType, LPCSTR Line)
- {
- if (!CNTService::IsService())
- return;
- if (Line && *Line)
- {
- if (Line[1] == 'E')
- CNTService::LogEvent(EVENTLOG_ERROR_TYPE, EVMSG_LOGERROR, "%s", Line);
- else if (Line[1] == 'E')
- CNTService::LogEvent(EVENTLOG_WARNING_TYPE, EVMSG_LOGWARN, "%s", Line);
- }
- }