However, for you there was no easy way to have the List & Label log output in the same place with your own logs. To make things more complicated, server apps typically run with separate credentials, which makes logging to file an error-prone and tedious task.
Enter the new logging interface support. It enables you to easily grab all debug output from List & Label and use your "normal" logging channel. This way, no matter if you use log4net, NLog, Boost.Log or any of the other logging libraries out there, you can get the LL output right where it belongs. This feature will be supported out of the box for .NET and C++ - support for other languages will vary with their COM and VARIANT support. This is what you'd have to implement on the .NET side for a minimal logger:
public class MyLogger : LoggerBase { public override bool WantOutput(LogLevels level, LogCategory category) { /* ... */ } public override void Debug(LogCategory category, string message, params object[] args) { /* ... */ } public override void Info(LogCategory category, string message, params object[] args) { /* ... */ } public override void Warn(LogCategory category, string message, params object[] args) { /* ... */ } public override void Error(LogCategory category, string message, params object[] args) { /* ... */ } }
ILlLogger customLogger; // use a NLog logger in List & Label customLogger = new ListLabel2NLogAdapter(NLog.LogManager.GetLogger("LL.Export")); // or use a log4net logger customLogger = new ListLabel2Log4NetAdapter(log4net.LogManager.GetLogger("LL.Export")); // or use your own implementation of ILlLogger customLogger = new MyCustomLogger(); // Pass the logger to ListLabel and everything is set up using (var LL = new ListLabel(customLogger)) { // use List & Label as usual }
Besides offering the comfort of "everything in one place" this also greatly enhances the usability of List & Label logging in server applications.
And it's yet another feature that shows our commitment to our professional dev community. :-)
Jochen Bartlau leads the development at combit as Managing Director. He's a Microsoft .NET enthusiast driving innovation & agile project management. The mobile devices geek who used to be a physicist in his first life loves to spend his spare time with his family.