MCPcopy Index your code
hub / github.com/coder/coder / ProtoFromLog

Function ProtoFromLog

codersdk/agentsdk/convert.go:380–390  ·  view source on GitHub ↗
(log Log)

Source from the content-addressed store, hash-verified

378}
379
380func ProtoFromLog(log Log) (*proto.Log, error) {
381 lvl, ok := proto.Log_Level_value[strings.ToUpper(string(log.Level))]
382 if !ok {
383 return nil, xerrors.Errorf("unknown log level: %s", log.Level)
384 }
385 return &proto.Log{
386 CreatedAt: timestamppb.New(log.CreatedAt),
387 Output: SanitizeLogOutput(log.Output),
388 Level: proto.Log_Level(lvl),
389 }, nil
390}
391
392func ProtoFromLifecycle(req PostLifecycleRequest) (*proto.Lifecycle, error) {
393 s, ok := proto.Lifecycle_State_value[strings.ToUpper(string(req.State))]

Callers 1

EnqueueMethod · 0.85

Calls 4

Log_LevelTypeAlias · 0.92
SanitizeLogOutputFunction · 0.85
NewMethod · 0.65
ErrorfMethod · 0.45

Tested by

no test coverage detected