• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# ILog类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中ILog的典型用法代码示例。如果您正苦于以下问题:C# ILog类的具体用法?C# ILog怎么用?C# ILog使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ILog类属于命名空间,在下文中一共展示了ILog类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: EnsureTargetFile

 static void EnsureTargetFile(string pathToLock, ILog log)
 {
     try
     {
         var directoryName = Path.GetDirectoryName(pathToLock);
         if (!Directory.Exists(directoryName))
         {
             log.Info("Directory {0} does not exist - creating it now", pathToLock);
             Directory.CreateDirectory(directoryName);
         }
     }
     catch (IOException)
     {
         //Someone else did this under us
     }
     try
     {
         if (!File.Exists(pathToLock))
         {
             File.WriteAllText(pathToLock, "A");
         }
     }
     catch (IOException)
     {
         //Someone else did this under us
     }
 }
开发者ID:xenoputtss,项目名称:Rebus,代码行数:27,代码来源:FilesystemExclusiveLock.cs


示例2: Inserir

        /// <exception cref="MyException"></exception>
        public void Inserir(ICliente cliente, ILog log)
        {
            var sql = new StringBuilder();
            var tblLog = new TblClientesLog();

            sql.AppendFormat(" INSERT INTO {0} ({1},{2},{3}", tblLog.NomeTabela, tblLog.Clientes_Id, tblLog.Clientes_Nome, tblLog.Clientes_Status_Id);
            sql.AppendFormat(",{0},{1},{2})", tblLog.Usuarios_Id, tblLog.Operacao_Id, tblLog.DataHora);
            sql.Append(" VALUES (@id,@nome,@status_id");
            sql.Append(",@usuarios_id,@operacao_id,@datahora);");

            using (var dal = new DalHelperSqlServer())
            {
                try
                {
                    dal.CriarParametroDeEntrada("id", SqlDbType.Int, cliente.Id);
                    dal.CriarParametroDeEntrada("nome", SqlDbType.Char, cliente.Nome);
                    dal.CriarParametroDeEntrada("status_id", SqlDbType.SmallInt, cliente.Status.GetHashCode());
                    dal.CriarParametroDeEntrada("usuarios_id", SqlDbType.Int, log.Usuario.Id);
                    dal.CriarParametroDeEntrada("operacao_id", SqlDbType.SmallInt, log.Operacao.GetHashCode());
                    dal.CriarParametroDeEntrada("datahora", SqlDbType.DateTime, log.DataHora);

                    dal.ExecuteNonQuery(sql.ToString());
                }
                catch (SqlException) { throw new MyException("Operação não realizada, por favor, tente novamente!"); }
            }
        }
开发者ID:phcbarros,项目名称:Estudos,代码行数:27,代码来源:DaoClienteLog.cs


示例3: CallMmCodeDataProvider

 public CallMmCodeDataProvider(IAmDataProvider dataProvider, IReadOnlyRepository repository, ILogCommandTypes logCommand)
 {
     _log = LogManager.GetLogger(GetType());
     _dataProvider = dataProvider;
     _repository = repository;
     _logCommand = logCommand;
 }
开发者ID:rjonker1,项目名称:lightstone-data-platform,代码行数:7,代码来源:CallMMCodeDataProvider.cs


示例4: ArchivingEngine

 public ArchivingEngine(
     string sourceRootFolder,
     string targetRootFolder,
     ArchivingSettings settings,
     TotalStatistics statistics,
     ILog log)
 {
     this.sourceRootFolder = sourceRootFolder;
     this.targetRootFolder = targetRootFolder;
     this.statistics = statistics;
     this.settings = settings;
     this.log = log;
     queue = new RingBuffer<Processing>();
     processingDistributor = new ProcessingDistributor(
         sourceRootFolder,
         targetRootFolder,
         statistics,
         queue,
         log);
     processingPool = new PipelinesPool(processingDistributor);
     retrievingDistributor = new RetrievingDistributor(
         queue,
         log);
     retrievingPool = new PipelinesPool(retrievingDistributor);
 }
开发者ID:vbogretsov,项目名称:threading,代码行数:25,代码来源:ArchivingEngine.cs


示例5: ApplicationContext

 public ApplicationContext(string projectRoot, ProjectConfig projectConfig, UserConfig userConfig, ILog log)
 {
     mProjectRoot = projectRoot;
     mProjectConfig = projectConfig;
     mUserConfig = userConfig;
     mLog = log;
 }
开发者ID:aiedail92,项目名称:DBBranchManager,代码行数:7,代码来源:ApplicationContext.cs


示例6: EventStoreEventPersistence

 public EventStoreEventPersistence(
     ILog log,
     IEventStoreConnection connection)
 {
     _log = log;
     _connection = connection;
 }
开发者ID:joaomajesus,项目名称:EventFlow,代码行数:7,代码来源:EventStoreEventPersistence.cs


示例7: ExecuteReplCommand

        public ExecuteReplCommand(
            string scriptName,
            string[] scriptArgs,
            IFileSystem fileSystem,
            IScriptPackResolver scriptPackResolver,
            IRepl repl,
            ILogProvider logProvider,
            IConsole console,
            IAssemblyResolver assemblyResolver,
            IFileSystemMigrator fileSystemMigrator,
            IScriptLibraryComposer composer)
        {
            Guard.AgainstNullArgument("fileSystem", fileSystem);
            Guard.AgainstNullArgument("scriptPackResolver", scriptPackResolver);
            Guard.AgainstNullArgument("repl", repl);
            Guard.AgainstNullArgument("logProvider", logProvider);
            Guard.AgainstNullArgument("console", console);
            Guard.AgainstNullArgument("assemblyResolver", assemblyResolver);
            Guard.AgainstNullArgument("fileSystemMigrator", fileSystemMigrator);
            Guard.AgainstNullArgument("composer", composer);

            _scriptName = scriptName;
            _scriptArgs = scriptArgs;
            _fileSystem = fileSystem;
            _scriptPackResolver = scriptPackResolver;
            _repl = repl;
            _logger = logProvider.ForCurrentType();
            _console = console;
            _assemblyResolver = assemblyResolver;
            _fileSystemMigrator = fileSystemMigrator;
            _composer = composer;
        }
开发者ID:JamesLinus,项目名称:scriptcs,代码行数:32,代码来源:ExecuteReplCommand.cs


示例8: SmtpClientSession

        public SmtpClientSession(ILog log, SmtpClientSessionConfiguration configuration, MessageData messageData)
        {
            _log = log;
            _configuration = configuration;

            _messageData = messageData;
        }
开发者ID:hmailserver,项目名称:hmailserver-net,代码行数:7,代码来源:SmtpClientSession.cs


示例9: TaskActions

		public TaskActions(RavenFileSystem fileSystem, ILog log)
			: base(fileSystem, log)
		{
			timer = Observable.Interval(TimeSpan.FromMinutes(1));

			InitializeTimer();
		}
开发者ID:GorelH,项目名称:ravendb,代码行数:7,代码来源:TaskActions.cs


示例10: DoLogDirectoryContent

        public static void DoLogDirectoryContent(ILog logger, string directory)
        {
            if (logger == null)
                throw new ArgumentNullException("logger");

            bool exists = Directory.Exists(directory);

            logger.Info("-- Logging directory content:");
            logger.Info("Directory: '" + directory + "'");
            logger.Info("Directory exists: " + exists);

            if (exists)
            {
                string[] files = Directory.GetFiles(directory);
                foreach (string file in files)
                {
                    FileInfo fileInfo = new FileInfo(file);
                    logger.Info("File: '" + file + "' (size=" + fileInfo.Length + ")");
                }

                string[] directories = Directory.GetDirectories(directory);
                foreach (string subDirectory in directories)
                {
                    logger.Info("Directory: '" + subDirectory + "'");
                }
            }

            logger.Info("--");
        }
开发者ID:ViniciusConsultor,项目名称:hudson-tray-tracker,代码行数:29,代码来源:LoggingHelper.cs


示例11: CommonScriptEngine

 protected CommonScriptEngine(IScriptHostFactory scriptHostFactory, ILogProvider logProvider)
 {
     Guard.AgainstNullArgument("logProvider", logProvider);
     ScriptOptions = new ScriptOptions().WithReferences(typeof(Object).Assembly);
     _scriptHostFactory = scriptHostFactory;
     _log = logProvider.ForCurrentType();
 }
开发者ID:scriptcs,项目名称:scriptcs,代码行数:7,代码来源:CommonScriptEngine.cs


示例12: RoslynScriptEngine

 public RoslynScriptEngine(IScriptHostFactory scriptHostFactory, ILog logger)
 {
     _scriptEngine = new ScriptEngine();
     _scriptEngine.AddReference(typeof(ScriptExecutor).Assembly);
     _scriptHostFactory = scriptHostFactory;
     _logger = logger;
 }
开发者ID:ChowZenki,项目名称:scriptcs,代码行数:7,代码来源:RoslynScriptEngine.cs


示例13: FilesEventPersistence

        public FilesEventPersistence(
            ILog log,
            IJsonSerializer jsonSerializer,
            IFilesEventStoreConfiguration configuration,
            IFilesEventLocator filesEventLocator)
        {
            _log = log;
            _jsonSerializer = jsonSerializer;
            _filesEventLocator = filesEventLocator;
            _logFilePath = Path.Combine(configuration.StorePath, "Log.store");

            if (File.Exists(_logFilePath))
            {
                var json = File.ReadAllText(_logFilePath);
                var eventStoreLog = _jsonSerializer.Deserialize<EventStoreLog>(json);
                _globalSequenceNumber = eventStoreLog.GlobalSequenceNumber;
                _eventLog = eventStoreLog.Log ?? new Dictionary<long, string>();

                if (_eventLog.Count != _globalSequenceNumber)
                {
                    eventStoreLog = RecreateEventStoreLog(configuration.StorePath);
                    _globalSequenceNumber = eventStoreLog.GlobalSequenceNumber;
                    _eventLog = eventStoreLog.Log;
                }
            }
            else
            {
                _eventLog = new Dictionary<long, string>();
            }
        }
开发者ID:liemqv,项目名称:EventFlow,代码行数:30,代码来源:FilesEventPersistence.cs


示例14: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        _logging = IoC.IoC.Get<ILog>();
        _date = IoC.IoC.Get<IDate>();
        _settings = IoC.IoC.Get<ISettings>();
        _emailNotificationItems = IoC.IoC.Get<IEmailNotificationItems>();
        _sendEmail = IoC.IoC.Get<IEmail>();
        _status = IoC.IoC.Get<IStatus>();

        var url = Request.Url.AbsoluteUri;

        if (Request.QueryString["csvfile"] == null)
        {
            numberOfRun += 1;
            _logging.Msg("CroneJob startet, " + numberOfRun);
            if (DateTime.Now.Hour == 8)
            {
                _sendEmail.SendEmail("[email protected]", "[email protected]", "Cronejob startet kl. 8:00, antal gange det er kørt siden sidst: " + numberOfRun, "");
                numberOfRun = 0;
            }
            url = null;
        }

        Run(url);
    }
开发者ID:NNSostack,项目名称:DataJuggling,代码行数:25,代码来源:Notification.ascx.cs


示例15: FilesWinService

        public FilesWinService(ILog log, IConfig config, IFirewallService firewallService)
            : base(log, true)
        {
            this.config = config;
            this.firewallService = firewallService;

            Uri baseAddress = config.FilesServiceUri;

            var webHttpBinding = new WebHttpBinding();
            webHttpBinding.Security.Mode = WebHttpSecurityMode.TransportCredentialOnly;
            webHttpBinding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Basic;

            var serviceHost =  new IocServiceHost(typeof(FilesService), baseAddress);
            base.serviceHost = serviceHost;

            ServiceEndpoint endpoint = serviceHost.AddServiceEndpoint(typeof(IFilesService), webHttpBinding, baseAddress);
            endpoint.Behaviors.Add(new WebHttpBehavior());
            ServiceCredential filesCredentials = config.FilesCredentials;
            #if DEBUG
            log.Debug("FilesWinService baseAddress: {0} credentials: {1}:{2}",
                baseAddress, filesCredentials.Username, filesCredentials.Password);
            #endif
            serviceHost.Credentials.UserNameAuthentication.CustomUserNamePasswordValidator = new CustomUserNamePasswordValidator(filesCredentials);
            serviceHost.Credentials.UserNameAuthentication.UserNamePasswordValidationMode = UserNamePasswordValidationMode.Custom;
        }
开发者ID:BrianMMcClain,项目名称:ironfoundry,代码行数:25,代码来源:FilesWinService.cs


示例16: Parse

 public static Feat Parse(WikiPage page, WikiExport export, ILog log = null)
 {
     var feat = new Feat();
     var parser = new FeatParser(feat, page, export);
     parser.Execute(log);
     return feat;
 }
开发者ID:Pathfinder-Fr,项目名称:WikiExportParser,代码行数:7,代码来源:FeatParser.cs


示例17: ScriptServices

 public ScriptServices(
     IFileSystem fileSystem,
     IPackageAssemblyResolver packageAssemblyResolver, 
     IScriptExecutor executor,
     IScriptEngine engine,
     IFilePreProcessor filePreProcessor,
     IReplCommandService replCommandService,
     IScriptPackResolver scriptPackResolver, 
     IPackageInstaller packageInstaller,
     ILog logger,
     IAssemblyResolver assemblyResolver,
     IConsole console = null,
     IInstallationProvider installationProvider = null 
     )
 {
     FileSystem = fileSystem;
     PackageAssemblyResolver = packageAssemblyResolver;
     Executor = executor;
     Engine = engine;
     FilePreProcessor = filePreProcessor;
     ReplCommandService = replCommandService;
     ScriptPackResolver = scriptPackResolver;
     PackageInstaller = packageInstaller;
     Logger = logger;
     Console = console;
     AssemblyResolver = assemblyResolver;
     InstallationProvider = installationProvider;
 }
开发者ID:ktroach,项目名称:scriptcs-replcommand-infra,代码行数:28,代码来源:ScriptServices.cs


示例18: AvaTaxRateProvider

 public AvaTaxRateProvider(IContactService customerService, ILog log, params SettingEntry[] settings)
     : this()
 {
     Settings = settings;
     _logger = new AvalaraLogger(log);
     _customerSearchService = customerService;
 }
开发者ID:afandylamusu,项目名称:vc-community,代码行数:7,代码来源:AvaTaxRateProvider.cs


示例19: ActionsBase

 protected ActionsBase(DocumentDatabase database, SizeLimitedConcurrentDictionary<string, TouchedDocumentInfo> recentTouches, IUuidGenerator uuidGenerator, ILog log)
 {
     Database = database;
     RecentTouches = recentTouches;
     UuidGenerator = uuidGenerator;
     Log = log;
 }
开发者ID:j2jensen,项目名称:ravendb,代码行数:7,代码来源:ActionsBase.cs


示例20: SetupService

		public SetupService(IConfigurationDataService configurationDataService, IPostDataService postDataService, ICategoryDataService categoryService, ILog logger)
		{
			this.configurationDataService = configurationDataService;
			this.postDataService = postDataService;
			this.categoryService = categoryService;
			this.logger = logger;
		}
开发者ID:prabhakara,项目名称:Dexter-Blog-Engine,代码行数:7,代码来源:SetupService.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# ILogFactory类代码示例发布时间:2022-05-24
下一篇:
C# ILockBytes类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap