BIND 10 trac901, updated. b5646b50e23e6049f233f755d7e143a09d4fb19c [trac901] Fix compilation from different dir
BIND 10 source code commits
bind10-changes at lists.isc.org
Fri May 6 07:43:48 UTC 2011
The branch, trac901 has been updated
via b5646b50e23e6049f233f755d7e143a09d4fb19c (commit)
via d4d910b28b3226d1330b7da1df170c406771b939 (commit)
via 7bb5dc265a830d8993c9cb1da55194631e657587 (commit)
via 1e3c154cd21cede83a8bbd7a559c20752b58ce24 (commit)
from 7c40e60eeaad7f2c1ea79f92e866dee08eafd5ab (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit b5646b50e23e6049f233f755d7e143a09d4fb19c
Author: Michal 'vorner' Vaner <michal.vaner at nic.cz>
Date: Tue May 3 20:44:50 2011 +0200
[trac901] Fix compilation from different dir
Cherry-pick from #744
commit d4d910b28b3226d1330b7da1df170c406771b939
Author: Michal 'vorner' Vaner <michal.vaner at nic.cz>
Date: Fri May 6 09:20:50 2011 +0200
[trac901] Makefile.am fix
commit 7bb5dc265a830d8993c9cb1da55194631e657587
Author: Michal 'vorner' Vaner <michal.vaner at nic.cz>
Date: Fri May 6 09:10:25 2011 +0200
[trac901] Message compiler uses new placeholders
commit 1e3c154cd21cede83a8bbd7a559c20752b58ce24
Author: Michal 'vorner' Vaner <michal.vaner at nic.cz>
Date: Fri May 6 09:01:19 2011 +0200
[trac901] readme update
-----------------------------------------------------------------------
Summary of changes:
src/lib/asiodns/Makefile.am | 2 +-
src/lib/log/README | 10 +++++-----
src/lib/log/compiler/message.cc | 11 +++++++----
3 files changed, 13 insertions(+), 10 deletions(-)
-----------------------------------------------------------------------
diff --git a/src/lib/asiodns/Makefile.am b/src/lib/asiodns/Makefile.am
index e7783e6..7beaaa3 100644
--- a/src/lib/asiodns/Makefile.am
+++ b/src/lib/asiodns/Makefile.am
@@ -8,7 +8,7 @@ AM_CPPFLAGS += -I$(top_srcdir)/src/lib/util -I$(top_builddir)/src/lib/util
AM_CXXFLAGS = $(B10_CXXFLAGS)
-CLEANFILES = *.gcno *.gcda
+CLEANFILES = *.gcno *.gcda asiodef.h asiodef.cc
# Define rule to build logging source files from message file
asiodef.h asiodef.cc: asiodef.msg
diff --git a/src/lib/log/README b/src/lib/log/README
index ed11b5b..d01b12f 100644
--- a/src/lib/log/README
+++ b/src/lib/log/README
@@ -96,7 +96,7 @@ An example file could be:
$PREFIX TEST_
$NAMESPACE isc::log
-TEST1 message %s is much too large
+TEST1 message %1 is much too large
+ This message is a test for the general message code
UNKNOWN unknown message
@@ -131,8 +131,8 @@ Points to note:
part of the line.
* Message lines. These comprise a symbol name and a message, which may
- include zero or more printf-style tokens. Symbol names will be upper-cased
- by the compiler.
+ include zero or more %1, %2... placeholder tokens. Symbol names will be
+ upper-cased by the compiler.
Message Compiler
@@ -252,14 +252,14 @@ To use the current version of the logging:
4. Issue logging calls using methods on logger, e.g.
- logger.error(DPS_NSTIMEOUT, "isc.org");
+ logger.error(DPS_NSTIMEOUT).arg("isc.org");
(where, in the example above we might have defined the symbol in the message
file with something along the lines of:
$PREFIX DPS_
:
- NSTIMEOUT queries to all nameservers for %s have timed out
+ NSTIMEOUT queries to all nameservers for %1 have timed out
At present, the only logging is to the console.
diff --git a/src/lib/log/compiler/message.cc b/src/lib/log/compiler/message.cc
index ef4bafd..eb9ddca 100644
--- a/src/lib/log/compiler/message.cc
+++ b/src/lib/log/compiler/message.cc
@@ -261,7 +261,7 @@ writeHeaderFile(const string& file, const string& prefix,
const vector<string>& ns_components, MessageDictionary& dictionary)
{
Filename message_file(file);
- Filename header_file(message_file.useAsDefault(".h"));
+ Filename header_file(Filename(message_file.name()).useAsDefault(".h"));
// Text to use as the sentinels.
string sentinel_text = sentinel(header_file);
@@ -358,7 +358,7 @@ writeProgramFile(const string& file, const string& prefix,
const vector<string>& ns_components, MessageDictionary& dictionary)
{
Filename message_file(file);
- Filename program_file(message_file.useAsDefault(".cc"));
+ Filename program_file(Filename(message_file.name()).useAsDefault(".cc"));
// Open the output file for writing
ofstream ccfile(program_file.fullName().c_str());
@@ -535,9 +535,12 @@ main(int argc, char* argv[]) {
string text = e.id();
text += ", ";
text += global.getText(e.id());
-
// Format with arguments
- text = isc::util::str::format(text, e.arguments());
+ vector<string> args(e.arguments());
+ for (size_t i(0); i < args.size(); ++ i) {
+ replacePlaceholder(&text, args[i], i + 1);
+ }
+
cerr << text << "\n";
return 1;
More information about the bind10-changes
mailing list