pull/1/head
unknown 5 years ago
parent 9a7d3d6a36
commit 697b42ab2c

@ -1,5 +1,4 @@
using System.Collections.Generic; using ZeroLevel.Models;
using ZeroLevel.Models;
using ZeroLevel.Network; using ZeroLevel.Network;
using ZeroLevel.Services.Applications; using ZeroLevel.Services.Applications;
@ -19,9 +18,9 @@ namespace ZeroLevel.Discovery
{ {
var routeTable = new RouteTable(); var routeTable = new RouteTable();
Injector.Default.Register<RouteTable>(routeTable); Injector.Default.Register<RouteTable>(routeTable);
var socketPort = Configuration.Default.First<int>("socketport"); var servicePort = Configuration.Default.First<int>("port");
_exInbox = UseHost(socketPort); _exInbox = UseHost(servicePort);
_exInbox.RegisterInbox<IEnumerable<ServiceEndpointsInfo>>("services", (_) => routeTable.Get()); _exInbox.RegisterInbox("services", (_) => routeTable.Get());
_exInbox.RegisterInbox<ZeroServiceInfo, InvokeResult>("register", (client, info) => routeTable.Append(info, client)); _exInbox.RegisterInbox<ZeroServiceInfo, InvokeResult>("register", (client, info) => routeTable.Append(info, client));
} }

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8" ?> <?xml version="1.0" encoding="utf-8" ?>
<configuration> <configuration>
<appSettings> <appSettings>
<add key="socketport" value="5012"/> <add key="port" value="5012"/>
<add key="log" value="logs"/> <add key="log" value="logs"/>
<add key="console" value="true"/> <add key="console" value="true"/>
</appSettings> </appSettings>

@ -156,10 +156,15 @@ namespace ZeroLevel
#endregion Delegate logger #endregion Delegate logger
#region Console #region Console
private static bool _console_log_enabled = false;
public static void AddConsoleLogger(LogLevel level = LogLevel.Standart) public static void AddConsoleLogger(LogLevel level = LogLevel.Standart)
{
if (_console_log_enabled == false)
{ {
AddLogger(new ConsoleLogger(), level); AddLogger(new ConsoleLogger(), level);
_console_log_enabled = true;
}
} }
#endregion Console #endregion Console

Loading…
Cancel
Save

Powered by TurnKey Linux.