当前位置: 首页>>代码示例>>C#>>正文


C# Logger.AddInfo方法代码示例

本文整理汇总了C#中System.Logger.AddInfo方法的典型用法代码示例。如果您正苦于以下问题:C# Logger.AddInfo方法的具体用法?C# Logger.AddInfo怎么用?C# Logger.AddInfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Logger的用法示例。


在下文中一共展示了Logger.AddInfo方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: RestoreFile

        /// -----------------------------------------------------------------------------
        /// <summary>
        /// The RestoreFile method restores a file from the backup folder
        /// </summary>
        /// <param name="installFile">The file to restore</param>
        /// <param name="basePath">The basePath to the file</param>
        /// <param name="log">A Logger to log the result</param>
        /// <history>
        /// 	[cnurse]	08/03/2007  created
        /// </history>
        /// -----------------------------------------------------------------------------
        public static void RestoreFile(InstallFile installFile, string basePath, Logger log)
        {
            string fullFileName = Path.Combine(basePath, installFile.FullName);
            string backupFileName = Path.Combine(installFile.BackupPath, installFile.Name + ".config");

            //Copy File back over install file
            FileSystemUtils.CopyFile(backupFileName, fullFileName);

            log.AddInfo(string.Format(FILE_RestoreBackup, installFile.FullName));
        }
开发者ID:rrsc,项目名称:Dnn.Platform,代码行数:21,代码来源:Util.cs

示例2: DeleteFile

 /// -----------------------------------------------------------------------------
 /// <summary>
 /// The DeleteFile method deletes a file.
 /// </summary>
 /// <param name="fileName">The file to delete</param>
 /// <param name="basePath">The basePath to the file</param>
 /// <param name="log">A Logger to log the result</param>
 /// <history>
 /// 	[cnurse]	08/03/2007  created
 /// </history>
 /// -----------------------------------------------------------------------------
 public static void DeleteFile(string fileName, string basePath, Logger log)
 {
     string fullFileName = Path.Combine(basePath, fileName);
     if (File.Exists(fullFileName))
     {
         RetryableAction.RetryEverySecondFor30Seconds(() => FileSystemUtils.DeleteFile(fullFileName), "Delete file " + fullFileName);
         log.AddInfo(string.Format(FILE_Deleted, fileName));
         string folderName = Path.GetDirectoryName(fullFileName);
         if (folderName != null)
         {
             var folder = new DirectoryInfo(folderName);
             TryDeleteFolder(folder, log);
         }
     }
 }
开发者ID:rrsc,项目名称:Dnn.Platform,代码行数:26,代码来源:Util.cs

示例3: BackupFile

        /// -----------------------------------------------------------------------------
        /// <summary>
        /// The BackupFile method backs up a file to the backup folder
        /// </summary>
        /// <param name="installFile">The file to backup</param>
        /// <param name="basePath">The basePath to the file</param>
        /// <param name="log">A Logger to log the result</param>
        /// <history>
        /// 	[cnurse]	08/03/2007  created
        /// </history>
        /// -----------------------------------------------------------------------------
        public static void BackupFile(InstallFile installFile, string basePath, Logger log)
        {
            string fullFileName = Path.Combine(basePath, installFile.FullName);
            string backupFileName = Path.Combine(installFile.BackupPath, installFile.Name + ".config");

            //create the backup folder if neccessary
            if (!Directory.Exists(installFile.BackupPath))
            {
                Directory.CreateDirectory(installFile.BackupPath);
            }

            //Copy file to backup location
            RetryableAction.RetryEverySecondFor30Seconds(() => FileSystemUtils.CopyFile(fullFileName, backupFileName), "Backup file " + fullFileName);
            log.AddInfo(string.Format(FILE_CreateBackup, installFile.FullName));
        }
开发者ID:rrsc,项目名称:Dnn.Platform,代码行数:26,代码来源:Util.cs

示例4: CopyFile

        /// -----------------------------------------------------------------------------
        /// <summary>
        /// The CopyFile method copies a file from the temporary extract location.
        /// </summary>
        /// <param name="installFile">The file to copy</param>
        /// <param name="basePath">The basePath to the file</param>
        /// <param name="log">A Logger to log the result</param>
        /// <history>
        /// 	[cnurse]	08/03/2007  created
        /// </history>
        /// -----------------------------------------------------------------------------
        public static void CopyFile(InstallFile installFile, string basePath, Logger log)
        {
            string filePath = Path.Combine(basePath, installFile.Path);
            string fullFileName = Path.Combine(basePath, installFile.FullName);

            //create the folder if neccessary
            if (!Directory.Exists(filePath))
            {
                log.AddInfo(string.Format(FOLDER_Created, filePath));
                Directory.CreateDirectory(filePath);
            }

            //Copy file from temp location
            RetryableAction.RetryEverySecondFor30Seconds(() => FileSystemUtils.CopyFile(installFile.TempFileName, fullFileName), "Copy file to " + fullFileName);

            log.AddInfo(string.Format(FILE_Created, installFile.FullName));
        }
开发者ID:rrsc,项目名称:Dnn.Platform,代码行数:28,代码来源:Util.cs

示例5: TryDeleteFolder

 private static void TryDeleteFolder(DirectoryInfo folder, Logger log)
 {
     if (folder.GetFiles().Length == 0 && folder.GetDirectories().Length == 0)
     {
         folder.Delete();
         log.AddInfo(string.Format(FOLDER_Deleted, folder.Name));
         TryDeleteFolder(folder.Parent, log);
     }
 }
开发者ID:rrsc,项目名称:Dnn.Platform,代码行数:9,代码来源:Util.cs


注:本文中的System.Logger.AddInfo方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。