diff options
| author | Shulhan <ms@kilabit.info> | 2022-02-17 11:26:57 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2022-02-17 11:26:57 +0700 |
| commit | c847880543d6654903d35c28d805575e44ab243e (patch) | |
| tree | 584d3f8ae489f69b53c486006acd7875da1e9bc0 | |
| parent | a702bcf35fad7171bb21bcdca82e152647d520ab (diff) | |
| download | pakakeh.go-c847880543d6654903d35c28d805575e44ab243e.tar.xz | |
lib/mlog: realign the struct MultiLogger
This changes make the MultiLogger struct to consume memory from 104
to 88 bytes (-16 bytes).
| -rw-r--r-- | lib/mlog/multi_logger.go | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/lib/mlog/multi_logger.go b/lib/mlog/multi_logger.go index 5c7f35d0..da9b8abc 100644 --- a/lib/mlog/multi_logger.go +++ b/lib/mlog/multi_logger.go @@ -25,16 +25,21 @@ import ( // time format in UTC and optional prefix. // type MultiLogger struct { - bufPool *sync.Pool + bufPool *sync.Pool + + qerr chan []byte + qout chan []byte + + qerrFlush chan bool + qflush chan bool + qoutFlush chan bool + + errs map[string]NamedWriter + outs map[string]NamedWriter + timeFormat string - prefix []byte - outs map[string]NamedWriter - errs map[string]NamedWriter - qout chan []byte - qerr chan []byte - qflush chan bool - qerrFlush chan bool - qoutFlush chan bool + + prefix []byte } // |
