Logs to a remote location that is listening at the given address and port. By default logs go
to the DeltaEngine.net:777 LogService. This way you can manage all issues and view all errors
on the DeltaEngine.net website for your project. Or use your own Log Server if you like.
View code on GitHub
Inheritance Hierarchy
DeltaEngine.Core Logger
DeltaEngine.Logging NetworkLogger
Namespace: DeltaEngine.Logging
Assembly: DeltaEngine.Logging (in DeltaEngine.Logging.dll) Version: 1.1.1.0 (1.1.1)
Syntax
The NetworkLogger type exposes the following members.
Constructors
Name | Description | |
---|---|---|
NetworkLogger | Initializes a new instance of the NetworkLogger class |
Methods
Name | Description | |
---|---|---|
CreateMessageTypePrefix | (Inherited from Logger.) | |
Dispose | (Inherited from Logger.) | |
Write | (Overrides Logger Write(Logger MessageType, String).) |
Properties
Name | Description | |
---|---|---|
LastMessage | (Inherited from Logger.) | |
NumberOfRepeatedMessagesIgnored | (Inherited from Logger.) |
Remarks
Examples
[TestFixtureSetUp] public void StartLogServer() { server = new LocalhostLogServer(new TcpServer()); server.Start(); new MockSettings(); var ready = false; var connection = new OnlineServiceConnection(); connection.DataReceived += o => ready = true; connection.Connect("localhost", LocalhostLogServer.Port); connection.Send(new LoginRequest("", "DeltaEngine.Logging.Tests")); logger = new NetworkLogger(connection); for (int timeoutMs = 1000; timeoutMs > 0 && !ready; timeoutMs -= 10) Thread.Sleep(10); Assert.IsTrue(ready); }
[TestFixtureTearDown] public void ShutdownLogServer() { logger.Dispose(); server.Dispose(); }
[Test] public void LogInfoMessage() { logger.Write(Logger.MessageType.Info, "Hello"); ExpectThatServerHasReceivedMessage("Hello"); }
See Also