• Kirill Smelkov's avatar
    amari.xlog: Implement log rotation · a2c3afaa
    Kirill Smelkov authored
    Rotate output enb.xlog ourselves at sync points so that nothing is lost
    in the output (hello `logrotate copytruncate`) and so that we can emit
    pre- and post- logrotate syncs.
    
    Reuse logging's RotatingFileHandler and TimedRotatingFileHandler to
    implement actual rotation, but carefully wrap them in our writer
    classes so that we emit exactly the output we prepared explicitly
    without any headers prepended by logging, and that we explicitly control
    when rotation happens.
    
    /proposed-for-review-at !5
    a2c3afaa
xlog.py 33 KB