public ObjectCountController(ISimpleJson simpleJson, ISimpleJsonFile simpleJsonFile, ISimpleLogFactory simpleLogFactory, SimpleLogFactory simpleLogFactory2) { this.ReportAdd(); _simpleJson = simpleJson; _simpleJsonFile = simpleJsonFile; _simpleLogFactory = simpleLogFactory; _simpleLogFactory2 = simpleLogFactory2; }
public WebApiHelper(ISimpleLogFactory simpleLogFactory) { //todo: refactor code //var response = await httpClient.GetAsync(uri).ConfigureAwait(false); //var handler = new HttpClientHandler { AutomaticDecompression = DecompressionMethods.GZip }; //_httpClient = new HttpClient(handler); _httpClient = new HttpClient(); _simpleLog = simpleLogFactory.CreateLogFor(this); }
static void Main() { _simpleLogFactory = ExLogInit.SetupLogEx(); AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException; var servicesToRun = new ServiceBase[] { new SimpleTraceService() }; ServiceBase.Run(servicesToRun); }
public static ISimpleLogFactory LogWithSimpleEventBus(this ISimpleLogFactory simpleLogFactory) { var logActions = simpleLogFactory.LogActions; logActions.SetActions(SimpleEventBus, true, LogMessage); var initLog = simpleLogFactory.CreateLogFor("SimpleEventBusExtensions"); initLog.LogInfo(">>>> LogWithSimpleEventBus"); return(simpleLogFactory); }
public static ISimpleLog GetOrCreateLogFor(this ISimpleLogFactory factory, object instance) { if (instance == null) { throw new ArgumentNullException(nameof(instance)); } if (instance is Type type) { return(factory.GetOrCreateLogFor(type)); } return(factory.GetOrCreateLogFor(instance.GetType())); }
public static ISimpleLogFactory LogWithSimpleEventBus(this ISimpleLogFactory simpleLogFactory, ISimpleEventBus <AsyncMessageEvent> simpleEventBus = null) { simpleEventBus = simpleEventBus ?? SimpleEventBus <AsyncMessageEvent> .Resolve(); var logActions = simpleLogFactory.LogActions; logActions.SetActions("LogWithSimpleEventBus", true, args => { if (args?.Message != null) { simpleEventBus.Raise(new AsyncMessageEvent(args.Message.ToString())); } }); var initLog = simpleLogFactory.CreateLogFor("SimpleEventBusExtensions"); initLog.LogInfo(">>>> LogWithSimpleEventBus"); return(simpleLogFactory); }
public static ISimpleLog GetOrCreateLogFor <T>(this ISimpleLogFactory factory) { return(factory.GetOrCreateLogFor(typeof(T))); }
public static ISimpleLog GetOrCreateLogFor(this ISimpleLogFactory factory, Type type) { return(factory.GetOrCreate(type.FullName)); }
public MyLogFactory(ISimpleLogFactory simpleLogFactory) { _simpleLogFactory = simpleLogFactory; }