Logging and user interaction

pjf edited this page Oct 12, 2014 · 1 revision

The CKAN core is intended to be reusable across multiple clients, including consoles, native and web-based GUIs, and batch processes.

  • Use User.WriteLine() rather than Console.WriteLine(). You should only use Console.WriteLine() if you know there is going to be a console.
  • Use log4net generously:
    • log.Debug() for matters that will of only be interest to developers (--debug), and log.Info() for matters that users may find interesting when running with --verbose. Note that --debug implies --verbose.
    • log.Warn(), log.Error() and log.Fatal() will always be logged.
    • All log4net functions come with formatted versions. Eg: log.DebugFormat() or log.WarnFormat().
Clone this wiki locally
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.