@@ -525,6 +525,56 @@ public static void SetCrashKeyValue(string c, string value)
525525 Core . Cef . SetCrashKeyValue ( value , value ) ;
526526 }
527527
528+ /// <summary>
529+ /// Gets the current log level.
530+ /// When <see cref="CefSettingsBase.LogSeverity"/> is set to <see cref="LogSeverity.Disable"/> then
531+ /// no messages will be written to the log file, but FATAL messages will still be output to stderr.
532+ /// When logging is disabled this method will return <see cref="LogSeverity.Fatal"/>.
533+ /// </summary>
534+ /// <returns>Current Log Level</returns>
535+ public static LogSeverity GetMinLogLevel ( )
536+ {
537+ var severity = Core . Cef . GetMinLogLevel ( ) ;
538+
539+ //Manually convert the int into the enum
540+ //Values don't match (this is a difference in CEF/Chromium) implementation
541+ //we need to deal with it manually,
542+ //https://github.com/chromiumembedded/cef/blob/2a64387259cf14412e24c3267c8a1eb3b99a54e3/include/base/cef_logging.h#L186
543+ //const LogSeverity LOG_VERBOSE = -1;
544+ //const LogSeverity LOG_INFO = 0;
545+ //const LogSeverity LOG_WARNING = 1;
546+ //const LogSeverity LOG_ERROR = 2;
547+ //const LogSeverity LOG_FATAL = 3;
548+
549+ if ( severity == - 1 )
550+ {
551+ return LogSeverity . Verbose ;
552+ }
553+
554+ if ( severity == 0 )
555+ {
556+ return LogSeverity . Info ;
557+ }
558+
559+ if ( severity == 1 )
560+ {
561+ return LogSeverity . Warning ;
562+ }
563+
564+ if ( severity == 2 )
565+ {
566+ return LogSeverity . Error ;
567+ }
568+
569+ if ( severity == 3 )
570+ {
571+ return LogSeverity . Fatal ;
572+ }
573+
574+ //No matching type, return the integer value as enum
575+ return ( LogSeverity ) severity ;
576+ }
577+
528578 /// <summary>
529579 /// Register the Widevine CDM plugin.
530580 ///
0 commit comments