Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rewrite logging system #180

Merged
merged 17 commits into from
Aug 14, 2021
Merged

Rewrite logging system #180

merged 17 commits into from
Aug 14, 2021

Conversation

pktiuk
Copy link
Member

@pktiuk pktiuk commented Aug 1, 2021

Closes #177
Closes #78

@pktiuk pktiuk force-pushed the rewrite_logging_system branch from fd54a71 to 3b35577 Compare August 1, 2021 20:43
@pktiuk
Copy link
Member Author

pktiuk commented Aug 1, 2021

It appears, previous Logger implementation didn't write to files, because this functionality was not implemented.
Now we have feature parity with previous version

@pktiuk
Copy link
Member Author

pktiuk commented Aug 3, 2021

My bad, logging into files was implemented properly, but it is impossible to log to file and to stdout at the same time.
At the very beginning of app logs are not saved to file, because selecting file as an output occurs later.

@pktiuk pktiuk force-pushed the rewrite_logging_system branch from b489efc to ae3da0f Compare August 5, 2021 19:09
It can't be done using QT parent mechanism, because Logger works in separate thread
@pktiuk pktiuk marked this pull request as ready for review August 5, 2021 20:28
@pktiuk
Copy link
Member Author

pktiuk commented Aug 5, 2021

Logs before:

$ antimicrox --log-level debug 
Debug: Socket's state:  QLocalSocket::UnconnectedState 
 ((null):0, (null))
Debug: Server name:  "" 
 ((null):0, (null))
Debug: Socket descriptor:  -1 
 ((null):0, (null))
Debug: The connection hasn't been established: 
error text ->  QLocalSocket::ServerNotFoundError 
error text 2 -> "QLocalSocket::connectToServer: Invalid name" 
 ((null):0, (null))
Debug: Socket is not valid 
 ((null):0, (null))

Logs now:


 ./build/bin/antimicrox --log-level debug 
[22:29:36.542] 🐞DEBUG  Socket's state:  QLocalSocket::UnconnectedState (file main.cpp:220)
[22:29:36.542] 🐞DEBUG  Server name:  "" (file main.cpp:221)
[22:29:36.542] 🐞DEBUG  Socket descriptor:  -1 (file main.cpp:222)
[22:29:36.542] 🐞DEBUG  The connection hasn't been established: 
                        error text ->  QLocalSocket::ServerNotFoundError 
                        error text 2 -> "QLocalSocket::connectToServer: Invalid name" (file main.cpp:223)
[22:29:36.543] 🐞DEBUG  Socket is not valid (file main.cpp:236)
[22:29:36.543] 🐞DEBUG  Socket's state:  QLocalSocket::UnconnectedState (file main.cpp:237)
[22:29:36.543] 🐞DEBUG  Server name:  "" (file main.cpp:238)
[22:29:36.543] 🐞DEBUG  Theme name:  "Pop" (file main.cpp:455)
[22:29:36.544] 🐞DEBUG  Displays don't have local data: create new instance of X11Extras (file x11extras.cpp:79)
[22:29:36.544] 🐞DEBUG  TOTAL:  102 (file qtx11keymapper.cpp:194)
[22:29:36.544] 🐞DEBUG  Display have local data (file x11extras.cpp:84)
[22:29:36.545] 🟢INFO   "Using XTest as the event generator." (file main.cpp:685)

@pktiuk pktiuk requested a review from gombosg August 6, 2021 13:51
@pktiuk
Copy link
Member Author

pktiuk commented Aug 6, 2021

@gombosg

Do you have any comments about this change?
In terms of interfaces, code readability, ease of use etc.

@pktiuk pktiuk merged commit de990a4 into master Aug 14, 2021
@pktiuk pktiuk deleted the rewrite_logging_system branch August 14, 2021 08:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refactor logging Saving logs into file doesn't work properly.
1 participant