SFML community forums
Help => System => Topic started by: inlinevoid on October 14, 2010, 12:33:40 pm
-
With the current project I'm working on, I'd like to be able to keep my console window color coded and formatted to a specific way to successful and non-successful loading.
The problem is the error output built into the LoadFromFile methods makes my console window look quite messy (since everything is color coded and has a specific format, the gray line that is printed doesn't match the rest of the console).
Is there anyway I can disable this?
EDIT: To make things as clear as possible, this is what I'm talking about:
Image 0 loaded!
Filepath: assets/gfx/default.png
Identifier: default
Image 1 loaded!
Filepath: assets/gfx/stick.png
Identifier: stick
Image 2 loaded!
Filepath: assets/gfx/delphine.png
Identifier: player
Failed to load image "assets/gfx/fluffy-grass.pn". Reason : Unable to open file (I don't want this line showing)
Image 3 failed to load!
Filepath: assets/gfx/fluffy-grass.pn
Identifier: grass
Sound 1 loaded!
Filename: assets/sfx/NOSOUND.ogg
Identifier: NOSOUND
-
You cannot disable SFML messages, but you can disable std::cerr, which is where SFML outputs its errors.
In SFML 2, messages are no longer sent to std::cerr, but to a specific ostream owned by SFML.
-
I see... Well then, off to the net to find out how to disable cerr. Thanks for your help, Laurent.
-
std::cerr.rdbuf(0);
;)
-
Thanks. :D