Changeset 248 in code for trunk/logger.go


Ignore:
Timestamp:
Apr 7, 2020, 7:54:24 PM (5 years ago)
Author:
contact
Message:

Make newMessageLogger take a *network instead of an *upstreamConn

There's no reason why messgeLogger needs access to the whole connection,
the network is enough.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/logger.go

    r247 r248  
    1212
    1313type messageLogger struct {
    14         conn   *upstreamConn
    15         entity string
     14        network *network
     15        entity  string
    1616
    1717        path string
     
    1919}
    2020
    21 func newMessageLogger(uc *upstreamConn, entity string) *messageLogger {
     21func newMessageLogger(network *network, entity string) *messageLogger {
    2222        return &messageLogger{
    23                 conn:   uc,
    24                 entity: entity,
     23                network: network,
     24                entity:  entity,
    2525        }
    2626}
     
    4747        // TODO: handle non-monotonic clock behaviour
    4848        now := time.Now()
    49         path := logPath(ml.conn.network, ml.entity, now)
     49        path := logPath(ml.network, ml.entity, now)
    5050        if ml.path != path {
    5151                if ml.file != nil {
Note: See TracChangeset for help on using the changeset viewer.