X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=ucw%2Flog-stream.c;h=5dbd71ff1c5bf63b3a090dc0d6693700eb9b4244;hb=17b1bcca21624757189a619506e93b42f4706b77;hp=5af9f3e6581ad264797e64c566ba0573db40f5d8;hpb=476c0da5319b155e0f4abec2b1fe6bc0c1fb6df7;p=libucw.git diff --git a/ucw/log-stream.c b/ucw/log-stream.c index 5af9f3e6..5dbd71ff 100644 --- a/ucw/log-stream.c +++ b/ucw/log-stream.c @@ -2,16 +2,16 @@ * UCW Library -- Logging: Management of Log Streams * * (c) 2008 Tomas Gavenciak - * (c) 2009 Martin Mares + * (c) 2009--2012 Martin Mares * * This software may be freely distributed and used according to the terms * of the GNU Lesser General Public License. */ -#include "ucw/lib.h" -#include "ucw/log.h" -#include "ucw/log-internal.h" -#include "ucw/simple-lists.h" +#include +#include +#include +#include #include @@ -170,6 +170,15 @@ log_set_format(struct log_stream *ls, uns mask, uns data) log_set_format(i->p, mask, data); } +void +log_set_default_stream(struct log_stream *ls) +{ + struct log_stream *def = log_stream_by_flags(0); + log_rm_substream(def, NULL); + log_add_substream(def, ls); + log_close_stream(ls); +} + /*** Registry of type names ***/ int log_register_type(const char *name)