L4N (Log4Nat) – a logging framework for Natural (by Software AG)

URL dieses Beitrags: http://blog.stefan-macke.com/2012/03/15/l4n-log4nat-a-logging-framework-for-natural-by-software-ag/

Along with NatUnit (a unit testing framework) we released L4N (or Log4Nat, or Log4Natural ;-)) on SourceForge today: L4N on SourceForge.

L4N offers basic logging functionality for Natural (by Software AG), including:

  • user- and module-specific logging
  • different log levels (e.g. debug, info, error)
  • combinable logging facilities (e.g. work file, INPUT, WRITE, database)

Using the framework is easy, as the following code shows:

  1. LOCAL USING L4NCONST /* some constants like log levels etc.
  2. LOCAL USING L4NPARAM /* the parameters (e.g. log text) for calling the actual logging
  3. * (optional) basic configuration of logging for the current module
  4. L4N-DEBUGUSER := ‘macke’
  5. L4N-LOGTYPES := C-LOGTYPE-FILE + C-LOGTYPE-WRITE
  6. L4N-LINENR := *LINE; L4N-DEBUGLEVEL := C-LOGLEVEL-DEBUG
  7. INCLUDE L4NENTER
  8. * the actual logging
  9. COMPRESS ‘Current value:’ #VALUE INTO L4N-LOGTEXT
  10. L4N-LINENR := *LINE; L4N-LOGLEVEL := C-LOGLEVEL-INFO
  11. INCLUDE L4NLOGIT

L4N is licensed under LGPL v3, so feel free to use it in your (commercial) applications or even help us further develop the framework.

Einen Kommentar schreiben

XHTML: Diese Tags sind erlaubt: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>