alloy: Add setting to customize log items

This commit is contained in:
Julien Bouix
2023-08-07 12:58:24 -04:00
committed by Marshall Greenblatt
parent 52b4d7ba5a
commit 01e1a0f44d
7 changed files with 130 additions and 4 deletions

View File

@@ -42,13 +42,13 @@
// way that may cause binary incompatibility with other builds. The universal
// hash value will change if any platform is affected whereas the platform hash
// values will change only if that particular platform is affected.
#define CEF_API_HASH_UNIVERSAL "7e96d7c2cfd58a4cf45baac9e75433f3cbb67f63"
#define CEF_API_HASH_UNIVERSAL "fa8cc34484fbca804b3b308446b2c144a0936003"
#if defined(OS_WIN)
#define CEF_API_HASH_PLATFORM "f3a24a5c20d1cbf169ea25398e9186370b6d8de1"
#define CEF_API_HASH_PLATFORM "c75b851a2b1000f42c9fd47065902d7500d036ec"
#elif defined(OS_MAC)
#define CEF_API_HASH_PLATFORM "96a030434c6766961380bb76d92dd59c20ffd2ff"
#define CEF_API_HASH_PLATFORM "67b3ee05c5c6243dedd1bcf061fe3c39c11d97e3"
#elif defined(OS_LINUX)
#define CEF_API_HASH_PLATFORM "5db43c0641a7a5638de64c9ab3d8807ddf6c9e9c"
#define CEF_API_HASH_PLATFORM "4da79d99f6eb7c7773e52da9f78a7c66f72c9c6d"
#endif
#ifdef __cplusplus

View File

@@ -132,6 +132,42 @@ typedef enum {
LOGSEVERITY_DISABLE = 99
} cef_log_severity_t;
///
/// Log items prepended to each log line.
///
typedef enum {
///
/// Prepend the default list of items.
///
LOG_ITEMS_DEFAULT = 0,
///
/// Prepend no items.
///
LOG_ITEMS_NONE = 1,
///
/// Prepend the process ID.
///
LOG_ITEMS_FLAG_PROCESS_ID = 1 << 1,
///
/// Prepend the thread ID.
///
LOG_ITEMS_FLAG_THREAD_ID = 1 << 2,
///
/// Prepend the timestamp.
///
LOG_ITEMS_FLAG_TIME_STAMP = 1 << 3,
///
/// Prepend the tickcount.
///
LOG_ITEMS_FLAG_TICK_COUNT = 1 << 4,
} cef_log_items_t;
///
/// Represents the state of a setting.
///
@@ -336,6 +372,14 @@ typedef struct _cef_settings_t {
///
cef_log_severity_t log_severity;
///
/// The log items prepended to each log line. If not set the default log items
/// will be used. Also configurable using the "log-items" command-line switch
/// with a value of "none" for no log items, or a comma-delimited list of
/// values "pid", "tid", "timestamp" or "tickcount" for custom log items.
///
cef_log_items_t log_items;
///
/// Custom flags that will be used when initializing the V8 JavaScript engine.
/// The consequences of using custom flags may not be well tested. Also

View File

@@ -408,6 +408,7 @@ struct CefSettingsTraits {
cef_string_set(src->log_file.str, src->log_file.length, &target->log_file,
copy);
target->log_severity = src->log_severity;
target->log_items = src->log_items;
cef_string_set(src->javascript_flags.str, src->javascript_flags.length,
&target->javascript_flags, copy);