-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from dezed-ukaea/main
Some smells
- Loading branch information
Showing
8 changed files
with
85 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,20 @@ | ||
#include "fdp/utilities/logging.hxx" | ||
|
||
namespace FDP { | ||
std::shared_ptr<spdlog::logger> create_logger_() { | ||
if (!spdlog::get("FDPAPI")) { | ||
return spdlog::stdout_color_st("FDPAPI"); | ||
} else { | ||
return spdlog::get("FDPAPI"); | ||
} | ||
} | ||
} // namespace FDP | ||
|
||
/*! ************************************************************************** | ||
* @brief Create a the global logger pointer | ||
* @author K. Zarebski (UKAEA) | ||
* | ||
* @return a shared pointer to the global logger instance | ||
****************************************************************************/ | ||
static logger::sptr create_logger() { | ||
if (!spdlog::get("FDPAPI")) { | ||
return spdlog::stdout_color_st("FDPAPI"); | ||
} else { | ||
return spdlog::get("FDPAPI"); | ||
} | ||
} | ||
|
||
const logger::sptr APILogger = create_logger(); | ||
} // namespace FDP |