Menu

The Log class

Weber Wang
2004-01-19
2004-01-19
  • Weber Wang

    Weber Wang - 2004-01-19

    I need a logger to support print messages to console or some string to output, but the Log class in this package can't do(or I will write to a text file and read it). I think you'd better provide a interface such as ISmtpLogger, and implemented by users who want it, the interface can include Write(), WriteLine(), etc(just like System.IO.TextWriter). By default you can implement a TextLogger to output messages to a text file just like the Log class. Then put a ISmtpLogger field in Smtp class(not static) and LogMessage just call the field's WriteLine() or other method, I can easily print messages to console just provide a ISmtpLogger and change the logger field.

     
    • Ian Stallings

      Ian Stallings - 2004-01-19

      This is also another good suggestion. I've been thinking about this myself and wanted to add not only console support but also Event Log capabilities. The log class was ill designed because I never really intended to use it publically. Not very well thought out in my opinion.

      Let me look at the code tonight and get back to you with any changes I intend to make. Thanks for your input again Weber, it is appreciated :)

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.