3030
3131/* stl header */
3232#include < algorithm>
33+ #include < iostream>
3334#include < mutex>
3435
3536/* magic enum */
@@ -70,17 +71,20 @@ namespace vx {
7071
7172 m_reopenInterval = std::chrono::seconds ( std::stoul ( interval->second ) );
7273 }
73- catch ( [[maybe_unused]] const std::invalid_argument &_exception ) {
74+ catch ( const std::invalid_argument &_exception ) {
7475
76+ std::cout << _exception.what () << std::endl;
7577 throw std::invalid_argument ( interval->second + " is not a valid reopen interval." );
7678 }
77- catch ( [[maybe_unused]] const std::out_of_range &_exception ) {
79+ catch ( const std::out_of_range &_exception ) {
7880
81+ std::cout << _exception.what () << std::endl;
7982 throw std::out_of_range ( interval->second + " is out of range reopen interval." );
8083 }
81- catch ( [[maybe_unused]] const std::exception &_exception ) {
84+ catch ( const std::exception &_exception ) {
8285
8386 /* nothing to do */
87+ std::cout << _exception.what () << std::endl;
8488 }
8589 }
8690
@@ -99,9 +103,10 @@ namespace vx {
99103 m_file.close ();
100104 }
101105 }
102- catch ( [[maybe_unused]] const std::exception &_exception ) {
106+ catch ( const std::exception &_exception ) {
103107
104108 /* nothing to do, file cannot be closed. */
109+ std::cout << _exception.what () << std::endl;
105110 }
106111 }
107112
@@ -119,7 +124,7 @@ namespace vx {
119124 output.append ( timestamp () );
120125
121126 std::string severity ( magic_enum::enum_name ( _severity ) );
122- std::transform ( std::begin ( severity ), std::end ( severity ), std::begin ( severity ), []( auto c ) { return ::toupper ( c ); } );
127+ std::transform ( std::begin ( severity ), std::end ( severity ), std::begin ( severity ), []( auto c ) { return std ::toupper ( c ); } );
123128 output.append ( " [" + severity + " ] " );
124129 if ( std::string ( _location.file_name () ) != " unsupported" ) {
125130
@@ -166,9 +171,10 @@ namespace vx {
166171 }
167172 m_file.open ( m_filename, std::ofstream::out | std::ofstream::app );
168173 }
169- catch ( [[maybe_unused]] const std::exception &_exception ) {
174+ catch ( const std::exception &_exception ) {
170175
171176 /* nothing to do, file is not open or cannot be closed. */
177+ std::cout << _exception.what () << std::endl;
172178 }
173179 m_lastReopen = std::chrono::system_clock::now ();
174180 }
0 commit comments