Commit 1c7930a7 authored by Stephen Morris's avatar Stephen Morris
Browse files

[trac1031] Remove unnecessary comma in messages

parent e9798fc8
......@@ -98,7 +98,7 @@ LoggerImpl::getEffectiveDebugLevel() {
// Output a general message
string*
LoggerImpl::lookupMessage(const MessageID& ident) {
return (new string(string(ident) + ", " +
return (new string(string(ident) + " " +
MessageDictionary::globalDictionary().getText(ident)));
}
......
......@@ -37,10 +37,10 @@ passfail() {
echo "1. One logger, multiple destinations:"
cat > $tempfile << .
FATAL [example] MSG_WRITERR, error writing to test1: 42
ERROR [example] MSG_RDLOCMES, reading local message file dummy/file
FATAL [example.beta] MSG_BADSEVERITY, unrecognized log severity: beta_fatal
ERROR [example.beta] MSG_BADDESTINATION, unrecognized log destination: beta_error
FATAL [example] MSG_WRITERR error writing to test1: 42
ERROR [example] MSG_RDLOCMES reading local message file dummy/file
FATAL [example.beta] MSG_BADSEVERITY unrecognized log severity: beta_fatal
ERROR [example.beta] MSG_BADDESTINATION unrecognized log destination: beta_error
.
rm -f $destfile1 $destfile2
./logger_example -s error -f $destfile1 -f $destfile2
......@@ -61,13 +61,13 @@ rm -f $destfile1 $destfile2
# Output for example.alpha should have done to destfile2.
cat > $tempfile << .
FATAL [example] MSG_WRITERR, error writing to test1: 42
ERROR [example] MSG_RDLOCMES, reading local message file dummy/file
WARN [example] MSG_BADSTREAM, bad log console output stream: example
FATAL [example.beta] MSG_BADSEVERITY, unrecognized log severity: beta_fatal
ERROR [example.beta] MSG_BADDESTINATION, unrecognized log destination: beta_error
WARN [example.beta] MSG_BADSTREAM, bad log console output stream: beta_warn
INFO [example.beta] MSG_READERR, error reading from message file beta: info
FATAL [example] MSG_WRITERR error writing to test1: 42
ERROR [example] MSG_RDLOCMES reading local message file dummy/file
WARN [example] MSG_BADSTREAM bad log console output stream: example
FATAL [example.beta] MSG_BADSEVERITY unrecognized log severity: beta_fatal
ERROR [example.beta] MSG_BADDESTINATION unrecognized log destination: beta_error
WARN [example.beta] MSG_BADSTREAM bad log console output stream: beta_warn
INFO [example.beta] MSG_READERR error reading from message file beta: info
.
echo -n " - destination 1:"
cut -d' ' -f3- $destfile1 | diff $tempfile -
......@@ -75,7 +75,7 @@ passfail $?
echo -n " - destination 2:"
cat > $tempfile << .
WARN [example.alpha] MSG_READERR, error reading from message file a.txt: dummy reason
WARN [example.alpha] MSG_READERR error reading from message file a.txt: dummy reason
.
cut -d' ' -f3- $destfile2 | diff $tempfile -
passfail $?
......
......@@ -37,36 +37,35 @@ passfail() {
# Create the local message file for testing
cat > $localmes << .
\$PREFIX MSG_
% NOTHERE this message is not in the global dictionary
% READERR replacement read error, parameters: '%1' and '%2'
% RDLOCMES replacement read local message file, parameter is '%1'
% MSG_NOTHERE this message is not in the global dictionary
% MSG_READERR replacement read error, parameters: '%1' and '%2'
% MSG_RDLOCMES replacement read local message file, parameter is '%1'
.
echo -n "1. Local message replacement:"
cat > $tempfile << .
WARN [example.log] MSG_IDNOTFND, could not replace message text for 'MSG_NOTHERE': no such message
FATAL [example] MSG_WRITERR, error writing to test1: 42
ERROR [example] MSG_RDLOCMES, replacement read local message file, parameter is 'dummy/file'
WARN [example] MSG_BADSTREAM, bad log console output stream: example
WARN [example.alpha] MSG_READERR, replacement read error, parameters: 'a.txt' and 'dummy reason'
FATAL [example.beta] MSG_BADSEVERITY, unrecognized log severity: beta_fatal
ERROR [example.beta] MSG_BADDESTINATION, unrecognized log destination: beta_error
WARN [example.beta] MSG_BADSTREAM, bad log console output stream: beta_warn
WARN [example.log] MSG_IDNOTFND could not replace message text for 'MSG_NOTHERE': no such message
FATAL [example] MSG_WRITERR error writing to test1: 42
ERROR [example] MSG_RDLOCMES replacement read local message file, parameter is 'dummy/file'
WARN [example] MSG_BADSTREAM bad log console output stream: example
WARN [example.alpha] MSG_READERR replacement read error, parameters: 'a.txt' and 'dummy reason'
FATAL [example.beta] MSG_BADSEVERITY unrecognized log severity: beta_fatal
ERROR [example.beta] MSG_BADDESTINATION unrecognized log destination: beta_error
WARN [example.beta] MSG_BADSTREAM bad log console output stream: beta_warn
.
./logger_example -c stdout -s warn $localmes | cut -d' ' -f3- | diff $tempfile -
passfail $?
echo -n "2. Report error if unable to read local message file:"
cat > $tempfile << .
ERROR [example.log] MSG_OPENIN, unable to open message file $localmes for input: No such file or directory
FATAL [example] MSG_WRITERR, error writing to test1: 42
ERROR [example] MSG_RDLOCMES, reading local message file dummy/file
WARN [example] MSG_BADSTREAM, bad log console output stream: example
WARN [example.alpha] MSG_READERR, error reading from message file a.txt: dummy reason
FATAL [example.beta] MSG_BADSEVERITY, unrecognized log severity: beta_fatal
ERROR [example.beta] MSG_BADDESTINATION, unrecognized log destination: beta_error
WARN [example.beta] MSG_BADSTREAM, bad log console output stream: beta_warn
ERROR [example.log] MSG_OPENIN unable to open message file $localmes for input: No such file or directory
FATAL [example] MSG_WRITERR error writing to test1: 42
ERROR [example] MSG_RDLOCMES reading local message file dummy/file
WARN [example] MSG_BADSTREAM bad log console output stream: example
WARN [example.alpha] MSG_READERR error reading from message file a.txt: dummy reason
FATAL [example.beta] MSG_BADSEVERITY unrecognized log severity: beta_fatal
ERROR [example.beta] MSG_BADDESTINATION unrecognized log destination: beta_error
WARN [example.beta] MSG_BADSTREAM bad log console output stream: beta_warn
.
rm -f $localmes
./logger_example -c stdout -s warn $localmes | cut -d' ' -f3- | diff $tempfile -
......
......@@ -35,44 +35,44 @@ passfail() {
echo -n "1. runInitTest default parameters:"
cat > $tempfile << .
FATAL [example] MSG_WRITERR, error writing to test1: 42
ERROR [example] MSG_RDLOCMES, reading local message file dummy/file
WARN [example] MSG_BADSTREAM, bad log console output stream: example
WARN [example.alpha] MSG_READERR, error reading from message file a.txt: dummy reason
INFO [example.alpha] MSG_OPENIN, unable to open message file example.msg for input: dummy reason
FATAL [example.beta] MSG_BADSEVERITY, unrecognized log severity: beta_fatal
ERROR [example.beta] MSG_BADDESTINATION, unrecognized log destination: beta_error
WARN [example.beta] MSG_BADSTREAM, bad log console output stream: beta_warn
INFO [example.beta] MSG_READERR, error reading from message file beta: info
FATAL [example] MSG_WRITERR error writing to test1: 42
ERROR [example] MSG_RDLOCMES reading local message file dummy/file
WARN [example] MSG_BADSTREAM bad log console output stream: example
WARN [example.alpha] MSG_READERR error reading from message file a.txt: dummy reason
INFO [example.alpha] MSG_OPENIN unable to open message file example.msg for input: dummy reason
FATAL [example.beta] MSG_BADSEVERITY unrecognized log severity: beta_fatal
ERROR [example.beta] MSG_BADDESTINATION unrecognized log destination: beta_error
WARN [example.beta] MSG_BADSTREAM bad log console output stream: beta_warn
INFO [example.beta] MSG_READERR error reading from message file beta: info
.
./logger_example -c stdout | cut -d' ' -f3- | diff $tempfile -
passfail $?
echo -n "2. Severity filter:"
cat > $tempfile << .
FATAL [example] MSG_WRITERR, error writing to test1: 42
ERROR [example] MSG_RDLOCMES, reading local message file dummy/file
FATAL [example.beta] MSG_BADSEVERITY, unrecognized log severity: beta_fatal
ERROR [example.beta] MSG_BADDESTINATION, unrecognized log destination: beta_error
FATAL [example] MSG_WRITERR error writing to test1: 42
ERROR [example] MSG_RDLOCMES reading local message file dummy/file
FATAL [example.beta] MSG_BADSEVERITY unrecognized log severity: beta_fatal
ERROR [example.beta] MSG_BADDESTINATION unrecognized log destination: beta_error
.
./logger_example -c stdout -s error | cut -d' ' -f3- | diff $tempfile -
passfail $?
echo -n "3. Debug level:"
cat > $tempfile << .
FATAL [example] MSG_WRITERR, error writing to test1: 42
ERROR [example] MSG_RDLOCMES, reading local message file dummy/file
WARN [example] MSG_BADSTREAM, bad log console output stream: example
WARN [example.alpha] MSG_READERR, error reading from message file a.txt: dummy reason
INFO [example.alpha] MSG_OPENIN, unable to open message file example.msg for input: dummy reason
DEBUG [example] MSG_RDLOCMES, reading local message file example/0
DEBUG [example] MSG_RDLOCMES, reading local message file example/24
DEBUG [example] MSG_RDLOCMES, reading local message file example/25
FATAL [example.beta] MSG_BADSEVERITY, unrecognized log severity: beta_fatal
ERROR [example.beta] MSG_BADDESTINATION, unrecognized log destination: beta_error
WARN [example.beta] MSG_BADSTREAM, bad log console output stream: beta_warn
INFO [example.beta] MSG_READERR, error reading from message file beta: info
DEBUG [example.beta] MSG_BADSEVERITY, unrecognized log severity: beta/25
FATAL [example] MSG_WRITERR error writing to test1: 42
ERROR [example] MSG_RDLOCMES reading local message file dummy/file
WARN [example] MSG_BADSTREAM bad log console output stream: example
WARN [example.alpha] MSG_READERR error reading from message file a.txt: dummy reason
INFO [example.alpha] MSG_OPENIN unable to open message file example.msg for input: dummy reason
DEBUG [example] MSG_RDLOCMES reading local message file example/0
DEBUG [example] MSG_RDLOCMES reading local message file example/24
DEBUG [example] MSG_RDLOCMES reading local message file example/25
FATAL [example.beta] MSG_BADSEVERITY unrecognized log severity: beta_fatal
ERROR [example.beta] MSG_BADDESTINATION unrecognized log destination: beta_error
WARN [example.beta] MSG_BADSTREAM bad log console output stream: beta_warn
INFO [example.beta] MSG_READERR error reading from message file beta: info
DEBUG [example.beta] MSG_BADSEVERITY unrecognized log severity: beta/25
.
./logger_example -c stdout -s debug -d 25 | cut -d' ' -f3- | diff $tempfile -
passfail $?
......
INFO [test.output] MSG_ID, Message with list [1, 2, 3, 4]
WARN [test.output] DIFFERENT, Different message
FATAL [test.output] MSG_ID, Message with 2 1
DEBUG [test.output] MSG_ID, Message with 3 2
INFO [test.output] MSG_ID Message with list [1, 2, 3, 4]
WARN [test.output] DIFFERENT Different message
FATAL [test.output] MSG_ID Message with 2 1
DEBUG [test.output] MSG_ID Message with 3 2
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment