Skip to content

Commit 85a8c28

Browse files
committed
Fix findings
1 parent 5e6c1d8 commit 85a8c28

File tree

2 files changed

+9
-16
lines changed

2 files changed

+9
-16
lines changed

code/Common/Logger.cpp

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
2121
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2222
-----------------------------------------------------------------------------------------------*/
2323
#include <cppcore/Common/Logger.h>
24+
2425
#include <cassert>
2526
#include <iomanip>
2627
#include <iostream>
@@ -29,9 +30,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2930

3031
namespace cppcore {
3132

32-
static constexpr char Line[] =
33-
"====================================================================================================";
34-
3533
static void appendDomain(const String &domain, String &logMsg) {
3634
if (!domain.isEmpty()) {
3735
logMsg += '(';
@@ -153,10 +151,8 @@ void Logger::print(const String &msg, PrintMode mode) {
153151
return;
154152
}
155153

156-
if (msg.size() > 8) {
157-
if (msg[6] == '<' && msg[7] == '=') {
158-
mIntention -= 2;
159-
}
154+
if (msg.size() > 8 && msg[6] == '<' && msg[7] == '=') {
155+
mIntention -= 2;
160156
}
161157

162158
String logMsg;
@@ -236,10 +232,7 @@ void Logger::unregisterLogStream(AbstractLogStream *logStream) {
236232
}
237233
}
238234

239-
Logger::Logger() :
240-
mLogStreams(),
241-
mVerboseMode(VerboseMode::Normal),
242-
mIntention(0) {
235+
Logger::Logger() {
243236
mLogStreams.add(new StdLogStream);
244237
}
245238

@@ -250,7 +243,7 @@ Logger::~Logger() {
250243
}
251244

252245
String Logger::getDateTime() {
253-
static const uint32_t Space = 2;
246+
//static const uint32_t Space = 2;
254247
/* DateTime currentDateTime = DateTime::getCurrentUTCTime();
255248
std::stringstream stream;
256249
stream.fill('0');

include/cppcore/Common/Logger.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ using String = TStringBase<char>;
3939
/// or a log window in a GUI application. Implement the write message and attach a valid instance
4040
/// to the logger itself to use your own implementation.
4141
//-------------------------------------------------------------------------------------------------
42-
class AbstractLogStream {
42+
class DLL_CPPCORE_EXPORT AbstractLogStream {
4343
public:
4444
/// @brief The default class destructor, virtual.
4545
virtual ~AbstractLogStream() = default;
@@ -81,7 +81,7 @@ class AbstractLogStream {
8181
/// supported modes are normal ( no debug and info messages ), verbose ( all messages will be
8282
/// logged ) and debug ( the debug messages will be logged as well, be careful with this option ).
8383
//-------------------------------------------------------------------------------------------------
84-
class Logger final {
84+
class DLL_CPPCORE_EXPORT Logger final {
8585
public:
8686
/// @brief Describes the verbode mode.
8787
enum class VerboseMode {
@@ -189,8 +189,8 @@ class Logger final {
189189

190190
using LogStreamArray = cppcore::TArray<AbstractLogStream*>;
191191
LogStreamArray mLogStreams;
192-
VerboseMode mVerboseMode;
193-
uint32_t mIntention;
192+
VerboseMode mVerboseMode{VerboseMode::Normal};
193+
uint32_t mIntention{0};
194194
};
195195

196196
// Logger helper function prototypes

0 commit comments

Comments
 (0)