Exemplo n.º 1
0
 public OrdersStorage(string apiUrl, ILoggerWriter loggerWriter = null, IJsonSerializer jsonSerializer = null)
 {
     _ordersProvider = new OrdersProvider(apiUrl, loggerWriter, jsonSerializer);
 }
Exemplo n.º 2
0
 public OrdersCreator(string apiUrl, ILoggerWriter loggerWriter = null, IJsonSerializer jsonSerializer = null)
 {
     _apiProxy = new OrdersApiProxy(apiUrl, loggerWriter, jsonSerializer);
 }
Exemplo n.º 3
0
 public OrdersProvider(string apiUrl, ILoggerWriter loggerWriter, IJsonSerializer jsonSerializer)
 {
     _apiProxy = new OrdersApiProxy(apiUrl, loggerWriter, jsonSerializer);
 }
Exemplo n.º 4
0
 public static void SetLogger(ILoggerWriter ilw)
 {
     InstructionLogger.loggerWriter = ilw;
     InstructionLogger.output = true;
 }
Exemplo 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;
 }
Exemplo n.º 7
0
        /// <summary>
        ///  使用数据库存储日志
        /// </summary>
        public static Spider UseDataBaseLog(this Spider spider, ILoggerWriter loggerWriter)
        {
            spider.AddLogProvider(new LogProvider(loggerWriter));

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