Add log rotation (#6564)

* Use flexi_logger; Add log rotation

* Add default rotation; Add FlexiLogger error

* Fix compilation error

* Remove logging to stdout if it's not a tty

* Fix formatting

Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>

* Remove needless debug statement

* Default to unlimited size for log rotation

* Add more comments about log-age option

* Remove unused variable

* Fix typo in comment

Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
This commit is contained in:
pscott
2020-07-08 12:11:09 +02:00
committed by GitHub
parent 62f306d972
commit 6eb2eb81c5
8 changed files with 324 additions and 84 deletions
+4
View File
@@ -17,6 +17,7 @@
// along with this program. If not, see <https://www.gnu.org/licenses/>.
//! Initialization errors.
use flexi_logger::FlexiLoggerError;
/// Result type alias for the CLI.
pub type Result<T> = std::result::Result<T, Error>;
@@ -32,6 +33,8 @@ pub enum Error {
Service(sc_service::Error),
/// Client error
Client(sp_blockchain::Error),
/// Flexi Logger error
FlexiLogger(FlexiLoggerError),
/// Input error
#[from(ignore)]
Input(String),
@@ -65,6 +68,7 @@ impl std::error::Error for Error {
Error::Cli(ref err) => Some(err),
Error::Service(ref err) => Some(err),
Error::Client(ref err) => Some(err),
Error::FlexiLogger(ref err) => Some(err),
Error::Input(_) => None,
Error::InvalidListenMultiaddress => None,
Error::Other(_) => None,