feat: add level support for startup logs (#7067)

This allows external services like our devcontainer support to display
errors and warnings with custom styles to indicate failures to users.
This commit is contained in:
Kyle Carberry
2023-04-10 14:29:59 -05:00
committed by GitHub
parent aa2468b16e
commit 81e2b2500a
17 changed files with 89 additions and 26 deletions
+2
View File
@@ -111,6 +111,7 @@ func TestInsertWorkspaceAgentStartupLogs(t *testing.T) {
AgentID: agent.ID,
CreatedAt: []time.Time{database.Now()},
Output: []string{"first"},
Level: []database.LogLevel{database.LogLevelInfo},
// 1 MB is the max
OutputLength: 1 << 20,
})
@@ -121,6 +122,7 @@ func TestInsertWorkspaceAgentStartupLogs(t *testing.T) {
AgentID: agent.ID,
CreatedAt: []time.Time{database.Now()},
Output: []string{"second"},
Level: []database.LogLevel{database.LogLevelInfo},
OutputLength: 1,
})
require.True(t, database.IsStartupLogsLimitError(err))