[sheepdog] [PATCH v5] logger: rename and change a role of select_log_formatter()

Hitoshi Mitake mitake.hitoshi at gmail.com
Mon Feb 11 12:40:20 CET 2013


At Wed, 06 Feb 2013 14:19:51 +0800,
Liu Yuan wrote:
> 
> On 02/05/2013 05:46 PM, Hitoshi Mitake wrote:
> > --- a/sheep/sheep.c
> > +++ b/sheep/sheep.c
> > @@ -432,6 +432,7 @@ int main(int argc, char **argv)
> >  	struct cluster_driver *cdrv;
> >  	struct option *long_options;
> >  	const char *log_format = "default";
> > +	static struct logger_user_info sheep_info;
> 
> Do we really need logger_user_info? Seems that you assume other
> formatter should use it when he wants to add more field. But now we only
> have json formatter, so for now it is only json related, and default
> formatter doesn't need it. So I'd suggest just hardcode port in the
> json_log_formatter() is good enough. Even if we need this structure,
> I think we'd better put logger_user_info in log.c instead of sheep.c.

Putting logger_user_info in log.c makes no sence because the source
files under lib/ directory can be used by other programs like collie
and shepherd. So the struct must be placed in sheep.c.

For the same reason, we can't hardcode port in
json_log_formatter(). logger.c can't read variables declared in user
side.

Thanks,
Hitoshi



More information about the sheepdog mailing list