aboutsummaryrefslogtreecommitdiffstats
path: root/src/ui/GpgFrontendUIInit.cpp
diff options
context:
space:
mode:
authorsaturneric <[email protected]>2023-11-29 12:45:48 +0000
committersaturneric <[email protected]>2023-11-29 12:45:48 +0000
commit635a6c16e982ba2a5c7bea28eb31ee235df158c2 (patch)
tree39561f439fdac98b813b671edabdc43f166b642d /src/ui/GpgFrontendUIInit.cpp
parentfix: repair gnupg info listing funtion (diff)
downloadGpgFrontend-635a6c16e982ba2a5c7bea28eb31ee235df158c2.tar.gz
GpgFrontend-635a6c16e982ba2a5c7bea28eb31ee235df158c2.zip
feat: introduce cmd functions
Diffstat (limited to 'src/ui/GpgFrontendUIInit.cpp')
-rw-r--r--src/ui/GpgFrontendUIInit.cpp16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/ui/GpgFrontendUIInit.cpp b/src/ui/GpgFrontendUIInit.cpp
index c3d6b69e..4fc3d8fa 100644
--- a/src/ui/GpgFrontendUIInit.cpp
+++ b/src/ui/GpgFrontendUIInit.cpp
@@ -50,12 +50,11 @@
namespace GpgFrontend::UI {
-extern void init_logging_system();
-extern void init_locale();
+extern void InitLocale();
void InitGpgFrontendUI(QApplication* app) {
// init locale
- init_locale();
+ InitLocale();
#if !defined(RELEASE) && defined(WINDOWS)
// css
@@ -198,7 +197,7 @@ int RunGpgFrontendUI(QApplication* app) {
return app->exec();
}
-void InitUILoggingSystem() {
+void InitUILoggingSystem(spdlog::level::level_enum level) {
using namespace boost::posix_time;
using namespace boost::gregorian;
@@ -221,11 +220,8 @@ void InitUILoggingSystem() {
ui_logger->set_pattern(
"[%H:%M:%S.%e] [T:%t] [%=6n] %^[%=8l]%$ [%s:%#] [%!] -> %v (+%ius)");
-#ifdef DEBUG
- ui_logger->set_level(spdlog::level::trace);
-#else
- ui_logger->set_level(spdlog::level::info);
-#endif
+ // set the level of logger
+ ui_logger->set_level(level);
// flush policy
ui_logger->flush_on(spdlog::level::err);
@@ -248,7 +244,7 @@ void ShutdownUILoggingSystem() {
* @brief setup the locale and load the translations
*
*/
-void init_locale() {
+void InitLocale() {
// get the instance of the GlobalSettingStation
auto& settings =
GpgFrontend::GlobalSettingStation::GetInstance().GetMainSettings();