[xwiki-devs] [vote] Logging format
Hi devs, I'd like to apply http://jira.xwiki.org/jira/browse/XWIKI-2667 , but one thing I'd like to change is the format of the log messages. The current patch uses String.format, but I prefer MessageFormat, as it is more expressive, and it is already used by the localization tool. So: 1. We use String.format, because: - it is "simpler" (some say) - it is familiar to C/C++ programmers - it is a bit more customizable at the finer level - the code is already written 2. We use MessageFormat, because: - it is already used for localization strings - it is more expressive (I really like the "choice" format) - it is apparently less customizable, but it uses good defaults (I'd rather specify that I want a "long" date format than a "DD MMMM HH:mm:ss z" format) - the changes are minimal - I for one prefer this syntax, rather than the old printf one. My +1 for option 2. -- Sergiu Dumitriu http://purl.org/net/sergiu/
I don't have a strong opinion on this so I'd say I'm +0 (I'll go with the flow). Maybe I'd go with 2 because that's what I've used for years and http://chaoticjava.com/posts/the-hardly-known-messageformat/ seems to say it's "better". Thanks -Vincent On Sep 27, 2008, at 5:04 AM, Sergiu Dumitriu wrote:
Hi devs,
I'd like to apply http://jira.xwiki.org/jira/browse/XWIKI-2667 , but one thing I'd like to change is the format of the log messages. The current patch uses String.format, but I prefer MessageFormat, as it is more expressive, and it is already used by the localization tool.
So: 1. We use String.format, because: - it is "simpler" (some say) - it is familiar to C/C++ programmers - it is a bit more customizable at the finer level - the code is already written
2. We use MessageFormat, because: - it is already used for localization strings - it is more expressive (I really like the "choice" format) - it is apparently less customizable, but it uses good defaults (I'd rather specify that I want a "long" date format than a "DD MMMM HH:mm:ss z" format) - the changes are minimal - I for one prefer this syntax, rather than the old printf one.
My +1 for option 2. -- Sergiu Dumitriu http://purl.org/net/sergiu/
+0 for 2 Sergiu Dumitriu wrote:
Hi devs,
I'd like to apply http://jira.xwiki.org/jira/browse/XWIKI-2667 , but one thing I'd like to change is the format of the log messages. The current patch uses String.format, but I prefer MessageFormat, as it is more expressive, and it is already used by the localization tool.
So: 1. We use String.format, because: - it is "simpler" (some say) - it is familiar to C/C++ programmers - it is a bit more customizable at the finer level - the code is already written
2. We use MessageFormat, because: - it is already used for localization strings - it is more expressive (I really like the "choice" format) - it is apparently less customizable, but it uses good defaults (I'd rather specify that I want a "long" date format than a "DD MMMM HH:mm:ss z" format) - the changes are minimal - I for one prefer this syntax, rather than the old printf one.
My +1 for option 2.
Prefer 2) too but not that much, lets say +0,5 ;) On Sat, Sep 27, 2008 at 5:04 AM, Sergiu Dumitriu <[email protected]> wrote:
Hi devs,
I'd like to apply http://jira.xwiki.org/jira/browse/XWIKI-2667 , but one thing I'd like to change is the format of the log messages. The current patch uses String.format, but I prefer MessageFormat, as it is more expressive, and it is already used by the localization tool.
So: 1. We use String.format, because: - it is "simpler" (some say) - it is familiar to C/C++ programmers - it is a bit more customizable at the finer level - the code is already written
2. We use MessageFormat, because: - it is already used for localization strings - it is more expressive (I really like the "choice" format) - it is apparently less customizable, but it uses good defaults (I'd rather specify that I want a "long" date format than a "DD MMMM HH:mm:ss z" format) - the changes are minimal - I for one prefer this syntax, rather than the old printf one.
My +1 for option 2. -- Sergiu Dumitriu http://purl.org/net/sergiu/ _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
-- Thomas Mortagne
Hi Sergiu, there is a small point against 2: Vincent stated that the current best practice is: logger.debug(String.format("text with %s in format syntax", var1, var2,...); http://n2.nabble.com/Hibernate-3.3.1-upgrade--tt1084964.html which would mean, that not only the Logger call has to be touched, but also the message has to be migrated. That could mean additional work in a full transition. The mentioned performance penalty can be probably be softened when using the Formatter directly (and keeping it) instead of String.format(). (Which always does somthing similar to: "return new Formatter(msg).format(args);" ) But I like the MessageFormat better in terms of readability. I dislike the mandatory(?) positional parameters. just three thoughts, Greetings Jonas Sergiu Dumitriu wrote:
Hi devs,
I'd like to apply http://jira.xwiki.org/jira/browse/XWIKI-2667 , but one thing I'd like to change is the format of the log messages. The current patch uses String.format, but I prefer MessageFormat, as it is more expressive, and it is already used by the localization tool.
So: 1. We use String.format, because: - it is "simpler" (some say) - it is familiar to C/C++ programmers - it is a bit more customizable at the finer level - the code is already written
2. We use MessageFormat, because: - it is already used for localization strings - it is more expressive (I really like the "choice" format) - it is apparently less customizable, but it uses good defaults (I'd rather specify that I want a "long" date format than a "DD MMMM HH:mm:ss z" format) - the changes are minimal - I for one prefer this syntax, rather than the old printf one.
My +1 for option 2.
+1 for 2 Sergiu Dumitriu wrote:
Hi devs,
I'd like to apply http://jira.xwiki.org/jira/browse/XWIKI-2667 , but one thing I'd like to change is the format of the log messages. The current patch uses String.format, but I prefer MessageFormat, as it is more expressive, and it is already used by the localization tool.
So: 1. We use String.format, because: - it is "simpler" (some say) - it is familiar to C/C++ programmers - it is a bit more customizable at the finer level - the code is already written
2. We use MessageFormat, because: - it is already used for localization strings - it is more expressive (I really like the "choice" format) - it is apparently less customizable, but it uses good defaults (I'd rather specify that I want a "long" date format than a "DD MMMM HH:mm:ss z" format) - the changes are minimal - I for one prefer this syntax, rather than the old printf one.
My +1 for option 2.
-- Artem Melentyev
Hi Sergiu, sorry to bother, but I noticed that the Interface-file changed. Thus the patch will not apply cleanly. Are you going to apply this patch? Since nobody really objected the MessageFormat I guess it is accepted? If it helps I can resubmit a patch using MessageFormat!/? greetings Jonas Sergiu Dumitriu wrote:
Hi devs,
I'd like to apply http://jira.xwiki.org/jira/browse/XWIKI-2667 , but one thing I'd like to change is the format of the log messages. The current patch uses String.format, but I prefer MessageFormat, as it is more expressive, and it is already used by the localization tool.
So: 1. We use String.format, because: - it is "simpler" (some say) - it is familiar to C/C++ programmers - it is a bit more customizable at the finer level - the code is already written
2. We use MessageFormat, because: - it is already used for localization strings - it is more expressive (I really like the "choice" format) - it is apparently less customizable, but it uses good defaults (I'd rather specify that I want a "long" date format than a "DD MMMM HH:mm:ss z" format) - the changes are minimal - I for one prefer this syntax, rather than the old printf one.
My +1 for option 2.
Jonas von Malottki wrote:
Hi Sergiu,
sorry to bother, but I noticed that the Interface-file changed. Thus the patch will not apply cleanly. Are you going to apply this patch?
Since nobody really objected the MessageFormat I guess it is accepted? If it helps I can resubmit a patch using MessageFormat!/?
If you can resubmit a patch, that would be perfect, it would save me some time thus it will be quickly applied. Thank you.
Sergiu Dumitriu wrote:
Hi devs,
I'd like to apply http://jira.xwiki.org/jira/browse/XWIKI-2667 , but one thing I'd like to change is the format of the log messages. The current patch uses String.format, but I prefer MessageFormat, as it is more expressive, and it is already used by the localization tool.
So: 1. We use String.format, because: - it is "simpler" (some say) - it is familiar to C/C++ programmers - it is a bit more customizable at the finer level - the code is already written
2. We use MessageFormat, because: - it is already used for localization strings - it is more expressive (I really like the "choice" format) - it is apparently less customizable, but it uses good defaults (I'd rather specify that I want a "long" date format than a "DD MMMM HH:mm:ss z" format) - the changes are minimal - I for one prefer this syntax, rather than the old printf one.
My +1 for option 2.
-- Sergiu Dumitriu http://purl.org/net/sergiu/
Hi Sergiu, should be good now. cheers Jonas http://jira.xwiki.org/jira/browse/XWIKI-2667 Sergiu Dumitriu wrote:
Jonas von Malottki wrote:
Hi Sergiu,
sorry to bother, but I noticed that the Interface-file changed. Thus the patch will not apply cleanly. Are you going to apply this patch?
Since nobody really objected the MessageFormat I guess it is accepted? If it helps I can resubmit a patch using MessageFormat!/?
If you can resubmit a patch, that would be perfect, it would save me some time thus it will be quickly applied.
Thank you.
Sergiu Dumitriu wrote:
Hi devs,
I'd like to apply http://jira.xwiki.org/jira/browse/XWIKI-2667 , but one thing I'd like to change is the format of the log messages. The current patch uses String.format, but I prefer MessageFormat, as it is more expressive, and it is already used by the localization tool.
So: 1. We use String.format, because: - it is "simpler" (some say) - it is familiar to C/C++ programmers - it is a bit more customizable at the finer level - the code is already written
2. We use MessageFormat, because: - it is already used for localization strings - it is more expressive (I really like the "choice" format) - it is apparently less customizable, but it uses good defaults (I'd rather specify that I want a "long" date format than a "DD MMMM HH:mm:ss z" format) - the changes are minimal - I for one prefer this syntax, rather than the old printf one.
My +1 for option 2.
participants (6)
-
Artem Melentyev -
Jonas von Malottki -
Marius Dumitru Florea -
Sergiu Dumitriu -
Thomas Mortagne -
Vincent Massol