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

Replace/Fix spdlog or implement a simple logger #56

Closed
Zardoz89 opened this issue Sep 28, 2015 · 9 comments
Closed

Replace/Fix spdlog or implement a simple logger #56

Zardoz89 opened this issue Sep 28, 2015 · 9 comments
Assignees
Labels
bug any security issue, any defect, any broken behaviour

Comments

@Zardoz89
Copy link
Member

Looks that spdlog clash badly with ASIO. ASIO have a higher priority over spdlog, so would be necessary try to fix spdlog or replace it.

List of requisites that should have a logger for us :

  • Multi-thread safe (a lock-free queue ? https://github.com/gabime/spdlog/blob/1bd10957cb47824c0e24859db2bd637e472ab97d/include/spdlog/details/mpmc_bounded_q.h )
  • Lightweight, we not need something with same level of bells and whistles that log4j
  • A way to write simple messages for different levels : errors, warnings, normal output and debug/trace messages.
  • A way to setup the log level output (ie, disable/enable debug and trace messages)
  • Log output to :
    • Errors and warnings should go to cerr (standard error output)
    • Normal and debug/trace to cout
    • All messages go to GUI Console
    • On a future, a way to write logs to a file. Because, when we have a server working, would be nice to read logs to track any issue or problem.
  • Optionally, a simple way to indicate from what class was the log write (errors, warnings and debug/trace), so could be filtered.
@Zardoz89 Zardoz89 added the bug any security issue, any defect, any broken behaviour label Sep 28, 2015
@Zardoz89
Copy link
Member Author

I'm taking a look how do a simple lightweight logger for our needs. I could do a try to doing it.

@Zardoz89 Zardoz89 changed the title Replace or implement a simple logger Replace/Fix spdlog or implement a simple logger Sep 28, 2015
@milesrout milesrout assigned milesrout and Zardoz89 and unassigned milesrout Sep 28, 2015
@milesrout
Copy link
Member

Assigned you @Zardoz89 as per your comment.

(Accidentally assigned myself first because the GitHub Issues interface is balls).

@gabime
Copy link

gabime commented Sep 28, 2015

@Zardoz89 could you provide details on how it clashes with ASIO? I would lke to fix this issue in spdlog

@adam4813
Copy link
Member

If I include asio before spdlog, spdlog throws and error about
GetDynamicTimzone being undefined because asio defines the windows version
to a low number for windows xp compatibility, but that number is to low
causing GetDynamicTimzone to be conditionally not compiled. The opposite
happens if I include spdlog before asio. Spdlog is including windows.h in a
way that causes winsock.h to be included that asio doesn't like and it
errors saying that winsock.h has already been included.

The solution was a preprocessor define of _WIN32_WINNT=600 (number might
need tweaking).
On Sep 28, 2015 12:57 PM, "Gabi Melman" notifications@github.com wrote:

@Zardoz89 https://github.com/Zardoz89 could you provide details on how
it clashes with ASIO? I would lke to fix this issue in spdlog


Reply to this email directly or view it on GitHub
#56 (comment).

@gabime
Copy link

gabime commented Sep 28, 2015

A quick fix would be to comment out line #170 in spdlog/details.os.h (and not use the z flag in the log pattern)

This will remove the need to define the offending =600 macro

@adam4813
Copy link
Member

adam4813 commented Oct 9, 2015

I am going to close this issue for now as a fix is there, albeit not a pretty one.

@adam4813 adam4813 closed this as completed Oct 9, 2015
@milesrout
Copy link
Member

@adam4813 Is the fix actually implemented?

@adam4813
Copy link
Member

adam4813 commented Oct 11, 2015 via email

@adam4813
Copy link
Member

adam4813 commented Oct 13, 2015 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug any security issue, any defect, any broken behaviour
Projects
None yet
Development

No branches or pull requests

4 participants