3636#include " core/GFLog.h"
3737#include " ui/GpgFrontendApplication.h"
3838
39+ namespace {
40+ auto BoolText (bool value) -> QString {
41+ return value ? QStringLiteral (" true" ) : QStringLiteral (" false" );
42+ }
43+
44+ auto DisplayPath (const QString& path) -> QString {
45+ return path.isEmpty () ? QStringLiteral (" <empty>" ) : path;
46+ }
47+ } // namespace
48+
3949namespace GpgFrontend {
4050
4151void GpgFrontendContext::load_env_conf_set_properties () {
@@ -49,31 +59,37 @@ void GpgFrontendContext::load_env_conf_set_properties() {
4959
5060 property (" GFSelfCheck" , s.value (" SelfCheck" , false ).toBool ());
5161 property (" GFSecureLevel" , s.value (" SecureLevel" , 0 ).toInt ());
52- property (" GFLogLevel" ,
53- s.value (" LogLevel" , static_cast <int >(GFLogLevel::kWARNING )).toInt ());
62+ property (
63+ " GFLogLevel" ,
64+ s.value (" LogLevel" , static_cast <int >(GFLogLevel::kCRITICAL )).toInt ());
5465 property (" GFPortableMode" , s.value (" PortableMode" , false ).toBool ());
5566 property (" GFGnuPGOfflineMode" , s.value (" GnuPGOfflineMode" , false ).toBool ());
5667 property (" GFPinentryProgramPath" ,
5768 s.value (" PinentryProgramPath" , " " ).toString ());
5869 property (" GFLogRingBufferCapacity" ,
5970 s.value (" LogRingBufferCapacity" , 1024 ).toInt ());
6071
61- qInfo () << " ENV"
62- << " GFSelfCheck" << property (" GFSelfCheck" ).toInt ();
63- qInfo () << " ENV"
64- << " GFSecureLevel" << property (" GFSecureLevel" ).toInt ();
65- qInfo () << " ENV"
66- << " GFLogLevel" << property (" GFLogLevel" ).toInt ();
67- qInfo () << " ENV"
68- << " GFPortableMode" << property (" GFPortableMode" ).toBool ();
69- qInfo () << " ENV"
70- << " GFGnuPGOfflineMode" << property (" GFGnuPGOfflineMode" ).toBool ();
71- qInfo () << " ENV"
72- << " GFPinentryProgramPath"
73- << property (" GFPinentryProgramPath" ).toString ();
74- qInfo () << " ENV"
75- << " GFLogRingBufferCapacity"
76- << property (" GFLogRingBufferCapacity" ).toInt ();
72+ const auto self_check = property (" GFSelfCheck" ).toInt ();
73+ const auto secure_level = property (" GFSecureLevel" ).toInt ();
74+ const auto log_level = property (" GFLogLevel" ).toInt ();
75+ const auto portable_mode = property (" GFPortableMode" ).toBool ();
76+ const auto gpg_offline_mode = property (" GFGnuPGOfflineMode" ).toBool ();
77+ const auto pinentry_program_path =
78+ property (" GFPinentryProgramPath" ).toString ();
79+ const auto ring_buffer_capacity = property (" GFLogRingBufferCapacity" ).toInt ();
80+
81+ qInfo ().noquote ().nospace ()
82+ << " \n "
83+ << " ================ GpgFrontend Startup Environment ================\n "
84+ << " Self Check : " << self_check << " \n "
85+ << " Secure Level : " << secure_level << " \n "
86+ << " Log Level : " << log_level << " \n "
87+ << " Portable Mode : " << BoolText (portable_mode) << " \n "
88+ << " GnuPG Offline Mode : " << BoolText (gpg_offline_mode) << " \n "
89+ << " Pinentry Program Path : " << DisplayPath (pinentry_program_path)
90+ << " \n "
91+ << " Log Ring Buffer Capacity: " << ring_buffer_capacity << " \n "
92+ << " ==================================================================" ;
7793}
7894
7995void GpgFrontendContext::InitApplication () {
0 commit comments