Skip to content

Commit

Permalink
Unit tests for the logging feature. (#1145)
Browse files Browse the repository at this point in the history
  • Loading branch information
bcoconni committed Aug 24, 2024
1 parent 941da03 commit dbf2eec
Show file tree
Hide file tree
Showing 4 changed files with 430 additions and 7 deletions.
8 changes: 4 additions & 4 deletions src/input_output/FGLog.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Module: FGOutputType.cpp
Module: FGLog.cpp
Author: Bertrand Coconnier
Date started: 05/03/24
Purpose: Manage output of sim parameters to file or stdout
Purpose: Manage the logging of messages
------------- Copyright (C) 2024 Bertrand Coconnier -------------
Expand All @@ -26,8 +26,8 @@
FUNCTIONAL DESCRIPTION
--------------------------------------------------------------------------------
This is the place where you create output routines to dump data for perusal
later.
This is the place where the logging of messages is managed. The messages can be
sent to the console, to a file, etc.
HISTORY
--------------------------------------------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions src/input_output/FGLog.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ class JSBSIM_API FGLogger
{
public:
virtual ~FGLogger() {}
virtual void SetLevel(LogLevel level) { level = level; }
virtual void SetLevel(LogLevel l) { level = l; }
virtual void FileLocation(const std::string& filename, int line) {}
void SetMinLevel(LogLevel level) { min_level = level; }
virtual void Message(const std::string& message) = 0;
Expand Down Expand Up @@ -148,7 +148,7 @@ class JSBSIM_API FGLogConsole : public FGLogger
{
public:
void FileLocation(const std::string& filename, int line) override
{ buffer << std::endl << "In file " << filename << ": line" << line << std::endl; }
{ buffer << std::endl << "In file " << filename << ": line " << line << std::endl; }
void Format(LogFormat format) override;
void Flush(void) override;

Expand Down
3 changes: 2 additions & 1 deletion tests/unit_tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ set(UNIT_TESTS FGColumnVector3Test
FGPropertyManagerTest
FGAtmosphereTest
FGAuxiliaryTest
FGMSISTest)
FGMSISTest
FGLogTest)


foreach(test ${UNIT_TESTS})
Expand Down
Loading

0 comments on commit dbf2eec

Please sign in to comment.