-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #22 from LykkeCity/Logging-system-redesign
Logging system redesign
- Loading branch information
Showing
9 changed files
with
55 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 13 additions & 6 deletions
19
Lykke.Service.LykkeService/client/Lykke.Service.LykkeService.Client/AutofacExtension.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,34 @@ | ||
using System; | ||
using Autofac; | ||
using Common.Log; | ||
using Autofac.Core; | ||
using JetBrains.Annotations; | ||
using Lykke.Common.Log; | ||
|
||
namespace Lykke.Service.LykkeService.Client | ||
{ | ||
[PublicAPI] | ||
public static class AutofacExtension | ||
{ | ||
public static void RegisterLykkeServiceClient(this ContainerBuilder builder, string serviceUrl, ILog log) | ||
public static void RegisterLykkeServiceClient(this ContainerBuilder builder, string serviceUrl) | ||
{ | ||
if (builder == null) throw new ArgumentNullException(nameof(builder)); | ||
if (log == null) throw new ArgumentNullException(nameof(log)); | ||
if (builder == null) | ||
{ | ||
throw new ArgumentNullException(nameof(builder)); | ||
} | ||
if (string.IsNullOrWhiteSpace(serviceUrl)) | ||
{ | ||
throw new ArgumentException("Value cannot be null or whitespace.", nameof(serviceUrl)); | ||
} | ||
|
||
builder.RegisterType<LykkeServiceClient>() | ||
.WithParameter("serviceUrl", serviceUrl) | ||
.As<ILykkeServiceClient>() | ||
.SingleInstance(); | ||
} | ||
|
||
public static void RegisterLykkeServiceClient(this ContainerBuilder builder, LykkeServiceServiceClientSettings settings, ILog log) | ||
public static void RegisterLykkeServiceClient(this ContainerBuilder builder, LykkeServiceServiceClientSettings settings) | ||
{ | ||
builder.RegisterLykkeServiceClient(settings?.ServiceUrl, log); | ||
builder.RegisterLykkeServiceClient(settings?.ServiceUrl); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 5 additions & 2 deletions
7
Lykke.Service.LykkeService/client/Lykke.Service.LykkeService.Client/LykkeServiceClient.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters