I am creating a logging namespace for a game that I am creating. The logging includes a file, and it would contain the following methods:
1 2 3 4
|
OUT::log(?)
OUT::warn(?)
OUT::critical(?)
OUT::debug(?)
|
I will want to call things like
OUT::log("Something happened");
and
OUT::log("Code process " + int proc + " occurred.");
but this might have to be changed to something like
OUT::log("Code process ", int proc, " occurred.");
What would I put in place of "?" to accomplish this?
I don't want to create 30 different methods for this, ie, not
1 2 3 4 5
|
OUT::log(string, int, string);
OUT::log(string, long, string);
OUT::log(string, double, string);
OUT::log(string, int);
OUT::log(string, int, string, int, string);
|
...I do NOT want to do this...too much chaos.
I understand in C++11, I could do something with int like to_string, and that would make the "string" + int + "string" to work.
So I need some help. Any suggestions?