Mirai-Team / mirai-project

C++ library for games making purposes.
Other
3 stars 0 forks source link

Remove Logger usage into MP #70

Closed Lomadriel closed 9 years ago

Lomadriel commented 9 years ago

I think that we have to remove it usage into our Library.

We could use cerr or sf::err. By using this, you can redirect errors on a file or simply display them in stdout stream.

Lomadriel commented 9 years ago

I wait a decision before starting to enhance the Logger. (see #69)

CBenoit commented 9 years ago

I agree. But it's quite similar to what is already done (the main difference is that, currently, streams are not redirect to std::cerr, which could be a Logger class improvement).

Moreover, and it should have its own issue, some parts can use asserts and throw to handle exceptions.

Lomadriel commented 9 years ago

Yes, I agree but we should allow users to choose where they want to write or print MP errors or warnings.

CBenoit said:

(the main difference is that, currently, streams are not redirect to std::cerr, which could be a Logger class improvement).

The new Logger will indeed allow this.

CBenoit commented 9 years ago

Yes. You can add that here : https://github.com/Mirai-Team/mirai-project/issues/69

Lomadriel commented 9 years ago

With the new logger we can set a default stream in a static variable to log warnings or errors.

This variable is equal by default to std::cout.rdbuf() but users can replace it by what they want.