NUDelta / orchestration-engine

Scripts to guide situated actions, powered by programming constructs that model ways of working
0 stars 0 forks source link

add logging of sent messages #29

Open kapil1garg opened 5 months ago

kapil1garg commented 5 months ago

in each of the feedbackFunctions, would be useful for debugging to know what messages were actually sent. Probably can instrument the sendSlackMessageToProjectChannel, sendSlackMessageToSigChannel, and sendSlackMessageToPeople functions.

Simple data structure:

// MessageLogSchema
{
  timestamp: Date as String // time when message was sent
  target {
    type: project|sig|people,
    projectName: String // project name if type is project; optional
    sigName: String // SIG name if type is SIG; optional
    people: String[] // list of people message was sent to if type is people; optional
  }
  message: String // message that was sent
  error: Object as String // error if happens
}
kapil1garg commented 5 months ago

801eb35 tried to add this, but I kept hitting a ReferenceError: MessageLog is not defined when adding it to the feedback functions. I added it to the postToStudioAPI function for now, but that doesn't listen for any errors in the request.

some options:

kapil1garg commented 5 months ago

Need to add this to all message functions -- only in message a list of people right now