Esempio n. 1
0
        /// <summary>
        /// Creates the instance core.
        /// </summary>
        /// <param name="loggerFactory">The logger factory.</param>
        /// <param name="fileSystem">The file system.</param>
        /// <returns>ICommonServices.</returns>
        /// <exception cref="ArgumentNullException">loggerFactory</exception>
        /// <autogeneratedoc />
        private static ICommonServices CreateInstanceCore(IPureLoggerFactory loggerFactory, IFileSystem fileSystem)
        {
            if (loggerFactory == null)
            {
                throw new ArgumentNullException(nameof(loggerFactory));
            }

            var processRunner    = new ProcessRunner(loggerFactory.CreatePureLogger <ProcessRunner>());
            var operationRunner  = new OperationRunner(loggerFactory.CreatePureLogger <OperationRunner>());
            var networkingSystem = new NetworkingSystem(loggerFactory.CreatePureLogger <NetworkingSystem>());

            return(new CommonServices(processRunner, fileSystem, networkingSystem, fileSystem.OperatingSystem, operationRunner, loggerFactory));
        }
Esempio n. 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="TcpListener"/> class.
 /// </summary>
 /// <param name="loggerFactory">The logger factory.</param>
 /// <exception cref="ArgumentNullException">loggerFactory</exception>
 /// <autogeneratedoc />
 public TcpListener(IPureLoggerFactory loggerFactory) : base(loggerFactory.CreatePureLogger <SocketListener>())
 {
     if (loggerFactory == null)
     {
         throw new ArgumentNullException(nameof(loggerFactory));
     }
 }
Esempio n. 3
0
 /// <summary>
 ///     Returns a Hangfire logger.
 /// </summary>
 public ILog GetLogger(string name)
 {
     return(new HangfireLogger(_loggerFactory?.CreatePureLogger(name)));
 }
Esempio n. 4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PureLoggableBase{T}"/> class.
 /// </summary>
 /// <param name="loggerFactory">The logger factory.</param>
 /// <param name="logger">The logger.</param>
 /// <exception cref="ArgumentNullException">loggerFactory</exception>
 /// <autogeneratedoc />
 public PureLoggableBase(IPureLoggerFactory loggerFactory, IPureLogger logger = null)
 {
     LoggerFactory = loggerFactory ?? throw new ArgumentNullException(nameof(loggerFactory));
     Logger        = logger ?? loggerFactory.CreatePureLogger <T>();
 }