dlr-gtlab / gt-logging

Basic C++14 logging library based on QsLog
0 stars 0 forks source link

Resolve "Add space/nospace and qoute/noqoute iomanips to alter stream flags on the fly" #130

Closed mariusalexander closed 5 months ago

mariusalexander commented 5 months ago

Closes #129

Implement manipulators gt::log::nospace, gt::log::space, gt::log::noquote, and gt::log::quote to alter the flags for logging spaces after the next messages and to log quotes around string types for the next message.

mariusalexander commented 5 months ago

@rainman110 Can you have a look at the changes?

Regarding nosapce and space: These only affect the next message, due to the way we implemented the space flag. It appends a space after the next message, thus the behavior may be a bit unexpected.

Example: Say I want to print "HelloWorld ..." for what ever reason

gtInfo() << "Hello"
         << gt::log::nospace
         << "World"
         << gt::log::space
         << "...";
// outputs: 'Hello World... '
gtInfo() << gt::log::nospace
         << "Hello"
         << gt::log::space
         << "World"
         << "...";
// outputs: 'HelloWorld ... '

As you can see, nosapce/space only affect the next message. What do you think, is it fine as is?