[PATCH] Weston: log.c, log.h: the files themselves

Pekka Paalanen ppaalanen at gmail.com
Sun May 27 01:14:19 PDT 2012


On Sat, 26 May 2012 20:44:40 +0200
Martin Minarik <minarik11 at student.fiit.stuba.sk> wrote:

> ---
>  src/log.c |   85 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>  src/log.h |   36 ++++++++++++++++++++++++++
>  2 files changed, 121 insertions(+), 0 deletions(-)
>  create mode 100644 src/log.c
>  create mode 100644 src/log.h
> 

Hi Martin,

this whole Weston series is messy, because it has patches spread over
more emails than there are supposed to be commits. Could you re-send
this as complete patches with "v2" on the subject-prefix and some comments
on what is different to the first series, please?

I also have some feedback first.

Drop W_PRINTF macro, and just use weston_log(). That macro offers
no additional information to the log, and will only confuse programmers
since there would be two names for the exact same function.

I was going to suggest that Weston writes its log by default to
stderr, and there would be a command line option for giving a file
name. If the file name is given, logging goes to that file instead.
As I often run Weston by hand on the command line, I would like it
to not print logs into stderr, when logging into a file, so I can
see the messages from weston-spawned clients.

The file should be opened in append mode, until (if) we implement
some log file rotation.

In this patch you are using function pointers like in libwayland,
but I think you can do this simpler here, and just always
vfprintf(weston_log_file, ...)
where
FILE *weston_log_file = stderr;
and the open log file function just sets that variable.


Thanks,
pq


More information about the wayland-devel mailing list