@@ -10,12 +10,12 @@ pub enum LoggerError {
1010 NeverInitialized ( String ) ,
1111 /// The logger does not allow reinitialization.
1212 AlreadyInitialized ,
13- /// Creating log file fails.
14- CreateLogFile ( std:: io:: Error ) ,
15- /// Writing to log file fails.
16- FileLogWrite ( std:: io:: Error ) ,
13+ /// Opening named pipe fails.
14+ OpenFIFO ( std:: io:: Error ) ,
15+ /// Writing to named pipe fails.
16+ LogWrite ( std:: io:: Error ) ,
1717 /// Flushing to disk fails.
18- FileLogFlush ( std:: io:: Error ) ,
18+ LogFlush ( std:: io:: Error ) ,
1919 /// Error obtaining lock on mutex.
2020 MutexLockFailure ( String ) ,
2121 /// Error in the logging of the metrics.
@@ -31,14 +31,14 @@ impl fmt::Display for LoggerError {
3131 LoggerError :: AlreadyInitialized => {
3232 format ! ( "{}" , "Reinitialization of logger not allowed." )
3333 }
34- LoggerError :: CreateLogFile ( ref e) => {
35- format ! ( "Failed to create log file . Error: {}" , e. description( ) )
34+ LoggerError :: OpenFIFO ( ref e) => {
35+ format ! ( "Failed to open pipe . Error: {}" , e. description( ) )
3636 }
37- LoggerError :: FileLogWrite ( ref e) => {
38- format ! ( "Failed to write to log file . Error: {}" , e. description( ) )
37+ LoggerError :: LogWrite ( ref e) => {
38+ format ! ( "Failed to write logs . Error: {}" , e. description( ) )
3939 }
40- LoggerError :: FileLogFlush ( ref e) => {
41- format ! ( "Failed to flush log file . Error: {}" , e. description( ) )
40+ LoggerError :: LogFlush ( ref e) => {
41+ format ! ( "Failed to flush logs . Error: {}" , e. description( ) )
4242 }
4343 LoggerError :: MutexLockFailure ( ref e) => format ! ( "{}" , e) ,
4444 LoggerError :: LogMetricFailure ( ref e) => format ! ( "{}" , e) ,
@@ -78,29 +78,29 @@ mod tests {
7878 assert ! (
7979 format!(
8080 "{:?}" ,
81- LoggerError :: FileLogWrite ( std:: io:: Error :: new( ErrorKind :: Interrupted , "write" ) )
82- ) . contains( "FileLogWrite " )
81+ LoggerError :: LogWrite ( std:: io:: Error :: new( ErrorKind :: Interrupted , "write" ) )
82+ ) . contains( "LogWrite " )
8383 ) ;
8484 assert_eq ! (
8585 format!(
8686 "{}" ,
87- LoggerError :: FileLogWrite ( std:: io:: Error :: new( ErrorKind :: Interrupted , "write" ) )
87+ LoggerError :: LogWrite ( std:: io:: Error :: new( ErrorKind :: Interrupted , "write" ) )
8888 ) ,
89- "Failed to write to log file . Error: write"
89+ "Failed to write logs . Error: write"
9090 ) ;
9191
9292 assert ! (
9393 format!(
9494 "{:?}" ,
95- LoggerError :: FileLogFlush ( std:: io:: Error :: new( ErrorKind :: Interrupted , "flush" ) )
96- ) . contains( "FileLogFlush " )
95+ LoggerError :: LogFlush ( std:: io:: Error :: new( ErrorKind :: Interrupted , "flush" ) )
96+ ) . contains( "LogFlush " )
9797 ) ;
9898 assert_eq ! (
9999 format!(
100100 "{}" ,
101- LoggerError :: FileLogFlush ( std:: io:: Error :: new( ErrorKind :: Interrupted , "flush" ) )
101+ LoggerError :: LogFlush ( std:: io:: Error :: new( ErrorKind :: Interrupted , "flush" ) )
102102 ) ,
103- "Failed to flush log file . Error: flush"
103+ "Failed to flush logs . Error: flush"
104104 ) ;
105105
106106 assert ! (
@@ -126,9 +126,9 @@ mod tests {
126126 assert_eq ! (
127127 format!(
128128 "{}" ,
129- LoggerError :: LogMetricFailure ( "Failure in the logging of the metrics." . to_string( ) )
129+ LoggerError :: LogMetricFailure ( "Failed to log metrics." . to_string( ) )
130130 ) ,
131- "Failure in the logging of the metrics."
131+ "Failed to log metrics."
132132 ) ;
133133
134134 assert ! ( format!( "{:?}" , LoggerError :: LogMetricRateLimit ) . contains( "LogMetricRateLimit" ) ) ;
0 commit comments