
log.c
-----

* automatically scale up/down log levels when messages are
  being logged too fast

    LOG_VERBOSE: foo
    .
    .
    .
    LOG_VERBOSE: bar
    LOG_WARNING: Flood detected: Scaling down log level to LOG_WARNING
    .
    .
    .
    LOG_WARNING: Restoring log level: LOG_VERBOSE

* add locking

* make it work correctly, whether O_NONBLOCK or not

* make log a daemon

memory.c
--------

* add a function to check for leaks at any given time
* don't print junk after fail kicks in (only first error message)

other
-----

* file descriptor leak detection

* make a fail module with callbacks that is called whenever something
  fails. these callbacks can be registered any time and also removed.

* fail should have void * parameter so that fail can take arguments

* implement stack trace function

* use Felix's suggestion:

       > Even better would be if you could somehow substitute malloc() with your own
       > version, so that if someone calls malloc() it actually calls
       > some_malloc_wrapper() which in turn calls the original malloc() function.
       > That way you can trap usage in the C library itself as well (e.g. if someone
       > uses strdup())

       You can actually do the latter.  Your wrapper would be named malloc and
       call __libc_malloc.

