//--------------------------------------------------- // void TargetNode::ConvertFileName() { char *pszName = GetFileName(), szNewName[2*_MAX_PATH+1]; if ( pszName ) { InternalConvertFileName(pszName, szNewName); DeleteFileName(); SetFileName(szNewName ); } pszName = GetFilePath(); if ( pszName ) { InternalConvertFileName(pszName, szNewName); DeleteFilePath(); SetFilePath(szNewName ); } TargetNode* pTarget = GetFirstChildTarget(); while ( pTarget ) { pTarget->ConvertFileName(); pTarget= pTarget->GetNext(); } }
void BaseInitLoggingImpl(const PathChar* new_log_file, LoggingDestination logging_dest, LogLockingState lock_log, OldFileDeletionState delete_old) { CommandLine* command_line = CommandLine::ForCurrentProcess(); g_enable_dcheck = command_line->HasSwitch(base::kEnableDCHECK); delete g_vlog_info; g_vlog_info = NULL; // 除非有vlog开关, 否则不必要初始化g_vlog_info if(command_line->HasSwitch(base::kV) || command_line->HasSwitch(base::kVModule)) { g_vlog_info = new VlogInfo(command_line->GetSwitchValueASCII(base::kV), command_line->GetSwitchValueASCII(base::kVModule)); } LoggingLock::Init(lock_log, new_log_file); LoggingLock logging_lock; if(log_file) { // calling InitLogging twice or after some log call has already opened the // default log file will re-initialize to the new options CloseFile(log_file); log_file = NULL; } logging_destination = logging_dest; // ignore file options if logging is disabled or only to system if(logging_destination==LOG_NONE || logging_destination==LOG_ONLY_TO_SYSTEM_DEBUG_LOG) { return; } if(!log_file_name) { log_file_name = new PathString(); } *log_file_name = new_log_file; if(delete_old == DELETE_OLD_LOG_FILE) { DeleteFilePath(*log_file_name); } InitializeLogFileHandle(); }
bool BaseInitLoggingImpl(const LoggingSettings& settings) { logging_destination = settings.logging_dest; // ignore file options unless logging to file is set. if ((logging_destination & LOG_TO_FILE) == 0) return true; LoggingLock::Init(settings.lock_log, settings.log_file); LoggingLock logging_lock; // Calling InitLogging twice or after some log call has already opened the // default log file will re-initialize to the new options. CloseLogFileUnlocked(); if (!log_file_name) log_file_name = new PathString(); *log_file_name = settings.log_file; if (settings.delete_old == DELETE_OLD_LOG_FILE) DeleteFilePath(*log_file_name); return InitializeLogFileHandle(); }