introduced linked list and generalize debug output devices

Signed-off-by: Boris Figovsky <borfig@gmail.com>