Skip to content

Uniformalize the logging messages, all layers are differents... #313

@christophe-lunarg

Description

@christophe-lunarg

validation layer:

                {
                    "key": "debug_action",
                    "label": "Debug Action",
                    "description": "Specifies what action is to be taken when a layer reports information",
                    "platforms": [ "WINDOWS", "LINUX", "MACOS", "ANDROID" ],
                    "type": "FLAGS",
                    "flags": [
                        {
                            "key": "VK_DBG_LAYER_ACTION_LOG_MSG",
                            "label": "Log Message",
                            "description": "Log a txt message to stdout or to a log filename.",
                            "settings": [
                                {
                                    "key": "log_filename",
                                    "label": "Log Filename",
                                    "description": "Specifies the output filename",
                                    "type": "SAVE_FILE",
                                    "default": "stdout",
                                    "dependence": {
                                        "mode": "ALL",
                                        "settings": [
                                            { "key": "debug_action", "value": [ "VK_DBG_LAYER_ACTION_LOG_MSG" ] }
                                        ]
                                    }
                                }
                            ]
                        },
                        {
                            "key": "VK_DBG_LAYER_ACTION_CALLBACK",
                            "label": "Callback",
                            "description": "Call user defined callback function(s) that have been registered via the VK_EXT_debug_report extension. Since application must register callback, this is a NOOP for the settings file.",
                            "view": "HIDDEN"
                        },
                        {
                            "key": "VK_DBG_LAYER_ACTION_DEBUG_OUTPUT",
                            "label": "Debug Output",
                            "description": "Log a txt message using the Windows OutputDebugString function.",
                            "platforms": [ "WINDOWS" ]
                        },
                        {
                            "key": "VK_DBG_LAYER_ACTION_BREAK",
                            "label": "Break",
                            "description": "Trigger a breakpoint if a debugger is in use."
                        }
                    ],
                    "default": [
                        "VK_DBG_LAYER_ACTION_LOG_MSG"
                    ]
                },
                {
                    "key": "report_flags",
                    "label": "Message Severity",
                    "description": "Comma-delineated list of options specifying the types of messages to be reported",
                    "platforms": [ "WINDOWS", "LINUX", "MACOS", "ANDROID" ],
                    "type": "FLAGS",
                    "flags": [
                        {
                            "key": "info",
                            "label": "Info",
                            "description": "Report informational messages.",
                            "messages": [
                                {
                                    "key": "printf_enable_msg2",
                                    "title": "Warning: Debug Printf without info level message severity flag",
                                    "version": 1,
                                    "description": "Disabling info level message severity is disabled, but Debug Printf output is directed to the debug callback, so printf message won't be shown.",
                                    "informative": "Adding 'info' level to 'Message Severity'",
                                    "severity": "INFORMATION",
                                    "conditions": [
                                        { "setting": { "key": "printf_enable", "value": true }},
                                        { "setting": { "key": "printf_to_stdout", "value": false }},
                                        { "setting": { "key": "report_flags", "value": ["info"]}, "operator": "NOT" }
                                    ],
                                    "actions": {
                                        "default": "BUTTON0",
                                        "BUTTON0": {
                                            "type": "OK",
                                            "changes": [
                                                { "setting": {"key": "report_flags", "value": ["info"]}, "operator": "APPEND" }
                                            ]
                                        }
                                    }
                                }
                            ]
                        },
                        {
                            "key": "warn",
                            "label": "Warning",
                            "description": "Report warnings from using the API in a manner which may lead to undefined behavior or to warn the user of common trouble spots. A warning does NOT necessarily signify illegal application behavior."
                        },
                        {
                            "key": "perf",
                            "label": "Performance",
                            "description": "Report usage of the API that may cause suboptimal performance."
                        },
                        {
                            "key": "error",
                            "label": "Error",
                            "description": "Report errors in API usage."
                        },
                        {
                            "key": "debug",
                            "label": "Debug",
                            "description": "For layer development. Report messages for debugging layer behavior.",
                            "view": "ADVANCED"
                        }
                    ],
                    "default": [
                        "error"
                    ]
                },

profiles layer:

                {
                    "key": "debug_actions",
                    "label": "Debug Actions",
                    "description": "This indicates what action is to be taken when a layer wants to report information",
                    "status": "STABLE",
                    "type": "FLAGS",
                    "platforms": [ "WINDOWS", "LINUX", "MACOS" ],
                    "flags": [
                        {
                            "key": "DEBUG_ACTION_STDOUT_BIT",
                            "label": "Log to stdout",
                            "description": "Log messages using the stdout."
                        },
                        {
                            "key": "DEBUG_ACTION_OUTPUT_BIT",
                            "label": "Log to OutputDebugString",
                            "description": "Log messages using the Windows OutputDebugString for Vulkan Studio output display.",
                            "platforms": [ "WINDOWS" ]
                        },
                        {
                            "key": "DEBUG_ACTION_FILE_BIT",
                            "label": "Log to File",
                            "description": "Log messages to a file.",
                            "settings": [
                                {
                                    "key": "debug_filename",
                                    "label": "Log Filename",
                                    "description": "Specifies the output filename",
                                    "type": "SAVE_FILE",
                                    "default": "profiles_layer_log.txt",
                                    "dependence": {
                                        "mode": "ANY",
                                        "settings": [
                                            {
                                                "key": "debug_actions",
                                                "value": [ "DEBUG_ACTION_FILE_BIT" ]
                                            },
                                            {
                                                "key": "debug_actions",
                                                "value": [ "DEBUG_ACTION_FILE_BIT", "DEBUG_ACTION_STDOUT_BIT" ]
                                            },
                                            {
                                                "key": "debug_actions",
                                                "value": [ "DEBUG_ACTION_FILE_BIT", "DEBUG_ACTION_OUTPUT_BIT" ]
                                            },
                                            {
                                                "key": "debug_actions",
                                                "value": [ "DEBUG_ACTION_FILE_BIT", "DEBUG_ACTION_BREAKPOINT_BIT" ]
                                            },
                                            {
                                                "key": "debug_actions",
                                                "value": [ "DEBUG_ACTION_FILE_BIT", "DEBUG_ACTION_STDOUT_BIT", "DEBUG_ACTION_OUTPUT_BIT" ]
                                            },
                                            {
                                                "key": "debug_actions",
                                                "value": [ "DEBUG_ACTION_FILE_BIT", "DEBUG_ACTION_STDOUT_BIT", "DEBUG_ACTION_BREAKPOINT_BIT" ]
                                            },
                                            {
                                                "key": "debug_actions",
                                                "value": [ "DEBUG_ACTION_FILE_BIT", "DEBUG_ACTION_OUTPUT_BIT", "DEBUG_ACTION_BREAKPOINT_BIT" ]
                                            },
                                            {
                                                "key": "debug_actions",
                                                "value": [ "DEBUG_ACTION_FILE_BIT", "DEBUG_ACTION_STDOUT_BIT", "DEBUG_ACTION_OUTPUT_BIT", "DEBUG_ACTION_BREAKPOINT_BIT" ]
                                            }
                                        ]
                                    }
                                },
                                {
                                    "key": "debug_file_clear",
                                    "label": "Clear Log at Launch",
                                    "description": "Discard the content of the log file between each layer run",
                                    "type": "BOOL",
                                    "default": true,
                                    "dependence": {
                                        "mode": "ANY",
                                        "settings": [
                                            {
                                                "key": "debug_actions",
                                                "value": [ "DEBUG_ACTION_FILE_BIT" ]
                                            },
                                            {
                                                "key": "debug_actions",
                                                "value": [ "DEBUG_ACTION_FILE_BIT", "DEBUG_ACTION_STDOUT_BIT" ]
                                            },
                                            {
                                                "key": "debug_actions",
                                                "value": [ "DEBUG_ACTION_FILE_BIT", "DEBUG_ACTION_OUTPUT_BIT" ]
                                            },
                                            {
                                                "key": "debug_actions",
                                                "value": [ "DEBUG_ACTION_FILE_BIT", "DEBUG_ACTION_BREAKPOINT_BIT" ]
                                            },
                                            {
                                                "key": "debug_actions",
                                                "value": [ "DEBUG_ACTION_FILE_BIT", "DEBUG_ACTION_STDOUT_BIT", "DEBUG_ACTION_OUTPUT_BIT" ]
                                            },
                                            {
                                                "key": "debug_actions",
                                                "value": [ "DEBUG_ACTION_FILE_BIT", "DEBUG_ACTION_STDOUT_BIT", "DEBUG_ACTION_BREAKPOINT_BIT" ]
                                            },
                                            {
                                                "key": "debug_actions",
                                                "value": [ "DEBUG_ACTION_FILE_BIT", "DEBUG_ACTION_OUTPUT_BIT", "DEBUG_ACTION_BREAKPOINT_BIT" ]
                                            },
                                            {
                                                "key": "debug_actions",
                                                "value": [ "DEBUG_ACTION_FILE_BIT", "DEBUG_ACTION_STDOUT_BIT", "DEBUG_ACTION_OUTPUT_BIT", "DEBUG_ACTION_BREAKPOINT_BIT" ]
                                            }
                                        ]
                                    }
                                }
                            ],
                            "platforms": [ "WINDOWS", "LINUX", "MACOS" ],
                            "expanded": true
                        },
                        {
                            "key": "DEBUG_ACTION_BREAKPOINT_BIT",
                            "label": "Break",
                            "description": "Trigger a breakpoint if a debugger is in use."
                        }
                    ],
                    "default": [ "DEBUG_ACTION_STDOUT_BIT" ]
                },
                {
                    "key": "debug_fail_on_error",
                    "label": "Fail on Error",
                    "description": "If the device doesn't support the capabilities of the selected Profile, the layer fail to load. When enabled, vkEnumeratePhysicalDevices will fail when the selected Profile is not supported.",
                    "status": "STABLE",
                    "type": "BOOL",
                    "platforms": [ "WINDOWS", "LINUX", "MACOS" ],
                    "default": false
                },
                {
                    "key": "debug_reports",
                    "label": "Message Types",
                    "description": "This is a comma-delineated list of options telling the layer what types of messages it should report back",
                    "status": "STABLE",
                    "type": "FLAGS",
                    "platforms": [ "WINDOWS", "LINUX", "MACOS" ],
                    "flags": [
                        {
                            "key": "DEBUG_REPORT_NOTIFICATION_BIT",
                            "label": "Notification",
                            "description": "Report notifications."
                        },
                        {
                            "key": "DEBUG_REPORT_WARNING_BIT",
                            "label": "Warning",
                            "description": "Report warnings from using the API in a manner which may lead to undefined behavior or to warn the user of common trouble spots. A warning does NOT necessarily signify illegal application behavior."
                        },
                        {
                            "key": "DEBUG_REPORT_ERROR_BIT",
                            "label": "Error",
                            "description": "Report errors in API usage."
                        },
                        {
                            "key": "DEBUG_REPORT_DEBUG_BIT",
                            "label": "Debug",
                            "description": "Report debug information for the Profiles Layer development.",
                            "view": "ADVANCED"
                        }
                    ],
                    "default": [
                        "DEBUG_REPORT_NOTIFICATION_BIT",
                        "DEBUG_REPORT_WARNING_BIT",
                        "DEBUG_REPORT_ERROR_BIT"
                    ]
                }

GFXReconstruct layer:

                        {
                            "key": "log_level",
                            "env": "GFXRECON_LOG_LEVEL",
                            "label": "Level",
                            "description": "Specify the minimum severity level of messages to log. Options are: debug, info, warning, error, and fatal. The specified level and all higher levels will be enabled for logging. For example, choosing the warning level will also enable the error and fatal levels.",
                            "type": "ENUM",
                            "flags": [
                                {
                                    "key": "debug",
                                    "label": "debug, info, warning, error, fatal",
                                    "description": ""
                                },
                                {
                                    "key": "info",
                                    "label": "info, warning, error, fatal",
                                    "description": ""
                                },
                                {
                                    "key": "warning",
                                    "label": "warning, error, fatal",
                                    "description": ""
                                },
                                {
                                    "key": "error",
                                    "label": "error, fatal",
                                    "description": ""
                                },
                                {
                                    "key": "fatal",
                                    "label": "fatal",
                                    "description": ""
                                }
                            ],
                            "default": "info"
                        },
                        {
                            "key": "log_output_to_console",
                            "env": "GFXRECON_LOG_OUTPUT_TO_CONSOLE",
                            "label": "Log Output to Console / stdout",
                            "description": "Log messages will be written to stdout.",
                            "type": "BOOL",
                            "default": true
                        },
                        {
                            "key": "log_break_on_error",
                            "env": "GFXRECON_LOG_BREAK_ON_ERROR",
                            "label": "Trigger Debug Break on Error",
                            "description": "Trigger a debug break when logging an error.",
                            "type": "BOOL",
                            "default": false
                        },
                        {
                            "key": "log_output_to_os_debug_string",
                            "env": "GFXRECON_LOG_OUTPUT_TO_OS_DEBUG_STRING",
                            "label": "Log Output to Debug Console",
                            "description": "Windows only option. Log messages will be written to the Debug Console with OutputDebugStringA",
                            "platforms": [ "WINDOWS" ],
                            "type": "BOOL",
                            "default": false
                        },
                        {
                            "key": "log_file",
                            "env": "GFXRECON_LOG_FILE",
                            "label": "Log File",
                            "description": "When set, log messages will be written to a file at the specified path. Default is: Empty string (file logging disabled).",
                            "type": "SAVE_FILE",
                            "filter": "*.txt",
                            "default": "",
                            "settings": [
                                {
                                    "key": "log_file_flush_after_write",
                                    "env": "GFXRECON_LOG_FILE_FLUSH_AFTER_WRITE",
                                    "label": "Log File Flush After Write",
                                    "description": "Flush the log file to disk after each write when true.",
                                    "type": "BOOL",
                                    "default": false
                                },
                                {
                                    "key": "log_file_keep_open",
                                    "env": "GFXRECON_LOG_FILE_KEEP_OPEN",
                                    "label": "Log File Keep Open",
                                    "description": "Keep the log file open between log messages when true, or close and reopen the log file for each message when false.",
                                    "type": "BOOL",
                                    "default": true
                                },
                                {
                                    "key": "log_file_create_new",
                                    "env": "GFXRECON_LOG_FILE_CREATE_NEW",
                                    "label": "Log File Overwrite",
                                    "description": "Specifies that log file initialization should overwrite an existing file when true, or append to an existing file when false.",
                                    "type": "BOOL",
                                    "default": true
                                }
                            ]
                        }

crash diagnostic layer

                        {
                            "key": "message_severity",
                            "label": "Message Severity",
                            "description": "Comma-delineated list of options specifying the types of log messages to be reported",
                            "type": "FLAGS",
                            "flags": [
                                {
                                    "key": "error",
                                    "label": "Error",
                                    "description": "Report errors such as device lost or setup problems in the layer."
                                },
                                {
                                    "key": "warn",
                                    "label": "Warning",
                                    "description": "Report non-fatal problems that may interfere with operation of the layer"
                                },
                                {
                                    "key": "info",
                                    "label": "Info",
                                    "description": "Report informational messages."
                                },
                                {
                                    "key": "verbose",
                                    "label": "Verbose",
                                    "description": "For layer development. Report messages for debugging layer behavior.",
                                    "view": "ADVANCED"
                                }
                            ],
                            "default": [
                                "error"
                            ],
                            "platforms": [
                                "WINDOWS",
                                "LINUX",
                                "MACOS",
                                "ANDROID"
                            ]
                        },
                        {
                            "key": "log_file",
                            "env": "CDL_LOG_FILE",
                            "label": "Log file name",
                            "description": "none = no logging, stderr or stdout = to the console, otherwise an absolute or relative path",
                            "type": "STRING",
                            "default": "stderr",
                            "platforms": [
                                "WINDOWS",
                                "LINUX",
                                "MACOS"
                            ]
                        },

api_dump layer:

                {
                    "key": "file",
                    "label": "Output to File",
                    "description": "Setting this to true indicates that output should be written to file instead of stdout",
                    "type": "BOOL",
                    "default": false,
                    "settings": [
                        {
                            "key": "log_filename",
                            "env": "VK_APIDUMP_LOG_FILENAME",
                            "label": "Log Filename",
                            "description": "Specifies the file to dump to when output files are enabled",
                            "type": "SAVE_FILE",
                            "filter": "*.txt,*.html,*.json",
                            "default": "stdout",
                            "dependence": {
                                "mode": "ALL",
                                "settings": [
                                    {
                                        "key": "file",
                                        "value": true
                                    }
                                ]
                            }
                        }
                    ]
                },

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions