Skip to content

Enhanced Debug Console Output #74

Description

@fafalone

Since the debug console already supports color, users being able to access the color as a property would aid in debugging by making it easier to see which particular line is currently important.

This can be accomplished with a .TextColor property in the Debug object.

Sub PrintCritical(sMsg As String)
Debug.TextColor = &HFF0000
Debug.Print sMsg
Debug.TextColor = vbDebugColorDefault ' (have a constant for the default color)
End Sub

Another useful feature would be a .PrintEx method that would take the color as an argument, as well as a Level argument.

Debug.PrintEx(message As String[, Level As tbLogLevels, Color As Long])

Then in project settings a corresponding setting of the minimum level to show. A helpful default enum,

Enum tbLogLevels
    LogInformation = 0
    LogMedium = 1000
    LogCritical = 2000
End Enum

the gaps would allow room for custom user levels.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions