ausocean / cloud

GNU General Public License v3.0
1 stars 1 forks source link

Overhaul logging for broadcast code #59

Closed saxon-milton closed 1 month ago

saxon-milton commented 1 month ago

Addresses issue #16

There were a lot of calls to "log.Printf" of the form "Broadcast: %s, id: %s ....", so we're factoring this pattern out. We're doing this by requiring that most interfaces that the broadcast code uses take a "log" parameter of type func(string,...interface{}). This means that we can pass around a log function that wraps any messages provided with the broadcast name and id.

We're now also using this in areas where the broadcast name and id were not specified. This means that all logging related to a particular broadcast is labelled as such.