Esempio n. 1
0
 public OrdersStorage(string apiUrl, ILoggerWriter loggerWriter = null, IJsonSerializer jsonSerializer = null)
 {
     _ordersProvider = new OrdersProvider(apiUrl, loggerWriter, jsonSerializer);
 }
 public OrdersCreator(string apiUrl, ILoggerWriter loggerWriter = null, IJsonSerializer jsonSerializer = null)
 {
     _apiProxy = new OrdersApiProxy(apiUrl, loggerWriter, jsonSerializer);
 }
 public OrdersProvider(string apiUrl, ILoggerWriter loggerWriter, IJsonSerializer jsonSerializer)
 {
     _apiProxy = new OrdersApiProxy(apiUrl, loggerWriter, jsonSerializer);
 }
Esempio n. 4
0
 public static void SetLogger(ILoggerWriter ilw)
 {
     InstructionLogger.loggerWriter = ilw;
     InstructionLogger.output = true;
 }
Esempio n. 5
0
 public Logger(string categoryName, ILoggerWriter writer)
 {
     _categoryName = categoryName;
     _writer       = writer ?? throw new ArgumentNullException(nameof(writer));
 }
 public AbstractLogger(string name, Func <string, LogLevel, bool> filter, ILoggerWriter loggerWriter)
 {
     _name         = string.IsNullOrEmpty(name) ? nameof(AbstractLogger) : name;
     _filter       = filter ?? ((category, logLevel) => true);
     _loggerWriter = loggerWriter;
 }
        /// <summary>
        ///  使用数据库存储日志
        /// </summary>
        public static Spider UseDataBaseLog(this Spider spider, ILoggerWriter loggerWriter)
        {
            spider.AddLogProvider(new LogProvider(loggerWriter));

            return(spider);
        }
Esempio n. 8
0
 public Logger(LoggerConfig config)
 {
     _config = config;
     _writer = new LoggerWriter(config.LogFile);
 }
Esempio n. 9
0
 public HttpRequester(IJsonSerializer jsonSerializer, ILoggerWriter loggerWriter)
 {
     _loggerWriter   = loggerWriter;
     _jsonSerializer = jsonSerializer ?? new NewtonsoftSerializer();
     _httpClient     = new HttpClient();
 }