[EMAIL PROTECTED] wrote on Wed, 05 Sep 2007 18:29 -0500:
> Right now the only way to do that is with two statements:
>
> PVFS_perror_gossip("failure removing storage space", errno);
> gossip_err("%s", storage_path);
>
> We might have a single gossip call:
>
> gossip_err_error(PVFS_error, const char * format, ...);
>
> for example. Seem reasonable?
I have wanted for PVFS_perror_gossip() to take varargs for a long
time now.
But thinking about it, your suggestion is better. Maybe
gossip_err_errno() for a name, though. But it will be a bit
awkward. We do:
gossip_err("this stinks\n");
to get
[E 12:33:45] this stinks
in the log
but will have to do
gossip_err_errno(err, "this stinks");
(no '\n') to let the _errno part glue
": %s\n"
onto the end. Or you could define it so that it always whacks off
an optional trailing \n before tacking on its bits, for consistency.
Weird, but cleaner for code that uses it.
But if you are the sort that likes "." at the end of sentences,
I don't know how to accomodate that cleanly.
For fun, if you stick to glibc, you can do this cute thing:
gossip_err("failure removing storage space: %m\n");
And you might consider trying:
gossip_err("failure removing storage space: %s\n", strerror(errno));
but that's not thread safe, which is presumably why we don't
have a "const char *PVFS_strerror(int errno)".
-- Pete
_______________________________________________
Pvfs2-developers mailing list
[email protected]
http://www.beowulf-underground.org/mailman/listinfo/pvfs2-developers