dept2 / CuteLogger

Logger: simple, convinient and thread safe logger for Qt-based C++ apps
GNU Lesser General Public License v2.1
148 stars 96 forks source link

exception when using FileAppender::setFileName #20

Closed enrico-dalla-via closed 5 years ago

enrico-dalla-via commented 8 years ago

HI, I'm using this library and it seems to work very good, but today I test the change of filename at runtime (basically I'm using a Qtimer to periodically check if the reference date is below at least 1 day from the current date. If yes, I'm calling setFileName to change the name of log file) and I got an exception every time I'm calling this function (I don't understand why, since the library has a Qmutex to protect the file name) more than 1 time.

Any suggestion or more information you need to understand what happens?

Thanks

enrico-dalla-via commented 8 years ago

I found the workaround solution, had to call removeAppender(m_FileAppender); create new fileAppender with a new filename and re-register it with registerAppender(m_FileAppender);

cyberbobs commented 8 years ago

Which exact exception are you getting? This behavior seems pretty strange to me and seemingly nothing in FileAppender source points to the possibility of this exact situation. If it would be possible for you to provide a simple test application reproducing this scenario it will help a lot with diagnosing and possibly fixing the problem.

cyberbobs commented 5 years ago

Since no comments came on that issue in 3 years I'm closing it. Feel free to reopen it with more info, if there is any.