X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=ucw%2Fdoc%2Flog.txt;h=61e443e9651e0355df5ab85a3585fcbc57489354;hb=bc2926a78de3d77995b83cc69369b1aaf480968e;hp=4eb15769e5a3a9f07dcb70c207b9fade63c02cd5;hpb=474d8444bdc73f99a19a9c48aa0efed1453423a4;p=libucw.git diff --git a/ucw/doc/log.txt b/ucw/doc/log.txt index 4eb15769..61e443e9 100644 --- a/ucw/doc/log.txt +++ b/ucw/doc/log.txt @@ -64,9 +64,9 @@ When a log stream receives a message, it is processed as follows: When no stream is explicitly selected, msg() uses the default stream, which has registration number 0 and which is also returned by log_default_stream(). This stream has no explicit destination, but it can have substreams. (When -a program starts, the default stream is connected to stderr; a call to log_file() +a program starts, the default stream is connected to stderr. A call to log_file() establishes a file logging stream and links it as the only substream of the -default stream.) +default stream. If you want to do that with any other log stream, call log_set_default_stream().) Streams are reference-counted. When a stream is created, it gets reference count 1. When it is linked as a substream of another stream, its reference count is incremented. @@ -82,7 +82,7 @@ Example int main(int argc, char **argv) { log_init(argv[0]); - struct log_stream *ls = log_new_file("/var/log/utterances"); + struct log_stream *ls = log_new_file("/var/log/utterances", 0); msg(L_INFO | ls->regnum, "Aye captain, we have a log file"); msg(L_INFO, "Alas, stderr still works"); return 0;