Join 34,000+ subscribers and receive articles from our
blog about software quality, testing, QA and security.

Console start after programmstart


#1

Hi @ all

I just wondered if it is possible to start console after the programm that logs has been started.

What have I to do to see online information in the console then?


#2

Hello Lothar,

This is possible, yes. This scenario is supported by the new named pipe protocol (which is now the default protocol of the SmartInspect libraries if you do not set the connections string).

Once you enable the logging (by setting the Enabled property to True), the libraries try to establish a connection to the configured logging destinations. The default behavior is to log to a local Console (via named pipes) and, if the first connection attempt failed because of the fact that no Console is running, the libraries try to reconnect in a configurable time interval.

This means that the libraries automatically detect when the Console is started and log messages start to appear in the Console.

For example, the following connections string uses the named pipe protocol and tries to reconnect to a local Console once per second:


#3

Hello Tobias

Thanks for reply.

Isn’t the reconnection an performance penalty :? ?

Thanks

Lothar


#4

In the case of the named pipe protocol, a reconnect attempt is just a call to CreateFile which is quite fast. And with the reconnect interval option as shown in the example above, the libraries do not try to reconnect for each log packet but only once per second (this value can be increased with the reconnect.interval option if you like, so that the libraries try to reconnect once per minute or hour only, for example, depending on your application).


#5

Thanks a lot