Details
-
Improvement
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
DataMapper 1.3
-
None
-
None
Description
I'm working on a project that uses 200 statements across 4 SqlMapper instances. Starting the program with DEBUG logging turned on generates about 62k of initialization log messages. Using Log4Net this takes about 1.4 seconds. Using the NoOpLogger it takes about 1.2 seconds.
When the logging section is missing from the App.config file (or well-formed but missing the IBatisNet.Logging.Log4Net assembly) the application defaults to the ConsoleLogger and the application takes over 15 seconds to initialize itself. The application is a .NET 1.1 WinForm.
If there isn't a logger defined, I think the default behavior should be to use the NoOpLogger instead of the ConsoleLogger. Perhaps we can add an additional property to the LogManager called Implementation (inspired by Sooda.Logging.LogManager) or FactoryAdapter so the implementation can be specified by the application:
if (isWinForm)
{
if (LogManager.FactoryAdapter is ConsoleOutLoggerFA)
}