Sign in to follow this  

[Solved] Logging with compiler generated constants

This topic is 3713 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I've got a logging system where every time I log a message I want to say where in the code that message came from. Currently I have:
Log("gfxengine.c","Initalise","Failed to set screen resolution");


Which logs... "12/10/2007 10:33:12 - gfxengine.c(Initalise) - Failed to set screen resolution" It's quite tedious having to the tell the Log routine something which the compiler should already know, where in the code we currently are. Ideally I could just use something along the lines of:
Log(__File,__Procedure,"Failed to set screen resolution");


Where the compiler fills in the details automatically. Unfortunately I can't see anything in the VS Cpp Express 2005 documentation to suggest that this feature might exist. Anyone know??? [Edited by - Racky1275 on October 12, 2007 7:31:03 AM]

Share this post


Link to post
Share on other sites

This topic is 3713 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this