diff options
author | Jaehyun Kim <jeik01.kim@samsung.com> | 2020-10-07 11:08:26 +0900 |
---|---|---|
committer | Jaehyun Kim <jeik01.kim@samsung.com> | 2020-10-07 19:55:10 +0900 |
commit | 92632d79d49dd50e5a162b2cb78ca53a75d570e2 (patch) | |
tree | b296be67afd3ef7242e95f494e41b718d5b69a36 /src/main.c | |
parent | 9395e7a086359069486e002c02b5777ca0c0df26 (diff) | |
download | connman-92632d79d49dd50e5a162b2cb78ca53a75d570e2.tar.gz connman-92632d79d49dd50e5a162b2cb78ca53a75d570e2.tar.bz2 connman-92632d79d49dd50e5a162b2cb78ca53a75d570e2.zip |
Add support for dlog
1. Add support for dlog
2. Add some log options to main.conf
3. Allow to simplify the amount of logs by option
Change-Id: I8c1202ae267aca9bb2c18d44c2ccd3e6d5a74a73
Signed-off-by: Jaehyun Kim <jeik01.kim@samsung.com>
Diffstat (limited to 'src/main.c')
-rwxr-xr-x | src/main.c | 48 |
1 files changed, 47 insertions, 1 deletions
@@ -104,6 +104,9 @@ static struct { char *global_nameserver; bool supplicant_debug; char *def_wifi_ifname; + bool file_log; + bool dlog_log; + bool simplified_log; #endif } connman_settings = { .bg_scan = true, @@ -134,6 +137,9 @@ static struct { .global_nameserver = NULL, .supplicant_debug = false, .def_wifi_ifname = DEFAULT_WIFI_INTERFACE, + .file_log = true, + .dlog_log = true, + .simplified_log = true, #endif }; @@ -221,6 +227,9 @@ static struct { #define CONF_GLOBAL_NAMESERVER "GlobalNameserver" #define CONF_CONNMAN_SUPPLICANT_DEBUG "ConnmanSupplicantDebug" #define CONF_CONNMAN_WIFI_DEF_IFNAME "DefaultWifiInterface" +#define CONF_CONNMAN_FILE_LOG "FileLogging" +#define CONF_CONNMAN_DLOG_LOG "DlogLogging" +#define CONF_CONNMAN_SIMPLIFIED_LOG "SimplifiedLog" #endif #if defined TIZEN_EXT @@ -279,6 +288,9 @@ static const char *supported_options[] = { CONF_GLOBAL_NAMESERVER, CONF_CONNMAN_SUPPLICANT_DEBUG, CONF_CONNMAN_WIFI_DEF_IFNAME, + CONF_CONNMAN_FILE_LOG, + CONF_CONNMAN_DLOG_LOG, + CONF_CONNMAN_SIMPLIFIED_LOG, #endif NULL }; @@ -666,6 +678,27 @@ static void check_Tizen_configuration(GKeyFile *config) g_clear_error(&error); + boolean = __connman_config_get_bool(config, "General", + CONF_CONNMAN_FILE_LOG, &error); + if (!error) + connman_settings.file_log = boolean; + + g_clear_error(&error); + + boolean = __connman_config_get_bool(config, "General", + CONF_CONNMAN_DLOG_LOG, &error); + if (!error) + connman_settings.dlog_log = boolean; + + g_clear_error(&error); + + boolean = __connman_config_get_bool(config, "General", + CONF_CONNMAN_SIMPLIFIED_LOG, &error); + if (!error) + connman_settings.simplified_log = boolean; + + g_clear_error(&error); + check_Tizen_INS_configuration(config); } @@ -907,7 +940,11 @@ static int config_init(const char *file) parse_config(config); if (config) g_key_file_free(config); - +#if defined TIZEN_EXT + dlog_logging = connman_settings.file_log; + file_logging = connman_settings.dlog_log; + simplified_log = connman_settings.simplified_log; +#endif return 0; } @@ -1134,6 +1171,15 @@ bool connman_setting_get_bool(const char *key) if (g_str_equal(key, CONF_CONNMAN_SUPPLICANT_DEBUG)) return connman_settings.supplicant_debug; + + if (g_str_equal(key, CONF_CONNMAN_FILE_LOG)) + return connman_settings.file_log; + + if (g_str_equal(key, CONF_CONNMAN_DLOG_LOG)) + return connman_settings.dlog_log; + + if (g_str_equal(key, CONF_CONNMAN_SIMPLIFIED_LOG)) + return connman_settings.simplified_log; #endif #if defined TIZEN_EXT |