mirror of
				https://github.com/tiagovignatti/intel-gpu-tools.git
				synced 2025-11-04 12:07:12 +00:00 
			
		
		
		
	lib: add a critical warning level
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
This commit is contained in:
		
							parent
							
								
									032f30cb38
								
							
						
					
					
						commit
						df11a0f4a8
					
				@ -1453,9 +1453,10 @@ void igt_skip_on_simulation(void)
 | 
			
		||||
 * between SUCESS and FAILURE.
 | 
			
		||||
 *
 | 
			
		||||
 * The log level can be set through the IGT_LOG_LEVEL environment variable with
 | 
			
		||||
 * values "debug", "info", "warn" and "none". By default verbose debug message
 | 
			
		||||
 * are disabled. "none" completely disables all output and is not recommended
 | 
			
		||||
 * since crucial issues only reported at the IGT_LOG_WARN level are ignored.
 | 
			
		||||
 * values "debug", "info", "warn", "critical" and "none". By default verbose
 | 
			
		||||
 * debug message are disabled. "none" completely disables all output and is not
 | 
			
		||||
 * recommended since crucial issues only reported at the IGT_LOG_WARN level are
 | 
			
		||||
 * ignored.
 | 
			
		||||
 */
 | 
			
		||||
void igt_log(const char *domain, enum igt_log_level level, const char *format, ...)
 | 
			
		||||
{
 | 
			
		||||
@ -1488,6 +1489,7 @@ void igt_vlog(const char *domain, enum igt_log_level level, const char *format,
 | 
			
		||||
		"DEBUG",
 | 
			
		||||
		"INFO",
 | 
			
		||||
		"WARNING",
 | 
			
		||||
		"CRITICAL",
 | 
			
		||||
		"NONE"
 | 
			
		||||
	};
 | 
			
		||||
 | 
			
		||||
@ -1514,7 +1516,7 @@ void igt_vlog(const char *domain, enum igt_log_level level, const char *format,
 | 
			
		||||
			return;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if (level == IGT_LOG_WARN) {
 | 
			
		||||
	if (level > IGT_LOG_WARN) {
 | 
			
		||||
		file = stderr;
 | 
			
		||||
		fflush(stdout);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
@ -520,6 +520,7 @@ enum igt_log_level {
 | 
			
		||||
	IGT_LOG_DEBUG,
 | 
			
		||||
	IGT_LOG_INFO,
 | 
			
		||||
	IGT_LOG_WARN,
 | 
			
		||||
	IGT_LOG_CRITICAL,
 | 
			
		||||
	IGT_LOG_NONE,
 | 
			
		||||
};
 | 
			
		||||
__attribute__((format(printf, 3, 4)))
 | 
			
		||||
@ -550,6 +551,15 @@ void igt_vlog(const char *domain, enum igt_log_level level, const char *format,
 | 
			
		||||
 * Wrapper for igt_log() for message at the IGT_LOG_WARN level.
 | 
			
		||||
 */
 | 
			
		||||
#define igt_warn(f...) igt_log(IGT_LOG_DOMAIN, IGT_LOG_WARN, f)
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * igt_critical:
 | 
			
		||||
 * @...: format string and optional arguments
 | 
			
		||||
 *
 | 
			
		||||
 * Wrapper for igt_log() for message at the IGT_LOG_CRITICAL level.
 | 
			
		||||
 */
 | 
			
		||||
#define igt_critical(f...) igt_log(IGT_LOG_DOMAIN, IGT_LOG_CRITICAL, f)
 | 
			
		||||
 | 
			
		||||
extern enum igt_log_level igt_log_level;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user