- Add RoutingWorkflow: generic state machine executor for WorkflowSpec - Add LLM Router: natural language → WorkflowSpec generation - Add RetrieveMemoryActivity: query poimen-memory for context - Add activities: AnalyzeCode, SecurityScan, GenerateReport, Notify, etc. - Add agent-prompts/router: LLM prompt documentation - Extend starter with --route flag for routing workflows - Remove orchestrator job (trigger via API/message instead) - Clean up: move docs to Desktop, add .gitignore for *.md
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
package action
|
||||
|
||||
import (
|
||||
"context"
|
||||
"log"
|
||||
|
||||
"go.temporal.io/sdk/activity"
|
||||
)
|
||||
|
||||
// activityLogger provides logging that works both in and outside Temporal context
|
||||
type activityLogger struct {
|
||||
ctx context.Context
|
||||
}
|
||||
|
||||
func newActivityLogger(ctx context.Context) *activityLogger {
|
||||
return &activityLogger{ctx: ctx}
|
||||
}
|
||||
|
||||
func (l *activityLogger) Info(msg string, args ...interface{}) {
|
||||
if activity.IsActivity(l.ctx) {
|
||||
activity.GetLogger(l.ctx).Info(msg, args...)
|
||||
} else {
|
||||
log.Printf("INFO: "+msg+" %v", args)
|
||||
}
|
||||
}
|
||||
|
||||
func (l *activityLogger) Warn(msg string, args ...interface{}) {
|
||||
if activity.IsActivity(l.ctx) {
|
||||
activity.GetLogger(l.ctx).Warn(msg, args...)
|
||||
} else {
|
||||
log.Printf("WARN: "+msg+" %v", args)
|
||||
}
|
||||
}
|
||||
|
||||
func (l *activityLogger) Error(msg string, args ...interface{}) {
|
||||
if activity.IsActivity(l.ctx) {
|
||||
activity.GetLogger(l.ctx).Error(msg, args...)
|
||||
} else {
|
||||
log.Printf("ERROR: "+msg+" %v", args)
|
||||
}
|
||||
}
|
||||
|
||||
func (l *activityLogger) Debug(msg string, args ...interface{}) {
|
||||
if activity.IsActivity(l.ctx) {
|
||||
activity.GetLogger(l.ctx).Debug(msg, args...)
|
||||
} else {
|
||||
log.Printf("DEBUG: "+msg+" %v", args)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user