EDIT: ***SOLUTION FOUND***
Just to check, before I had the 2 functions in the second code box I used in the main the logger function and when I got it to be private I haven't erased the lines in the main.
*********
Question:
hello, If you remember me from yesterday, having some problems. I've defined a helpFunctions.c pp class with static functions. now I have a static function that I don't need the user to see so I'm trying to make it private.it works fine as public but once I put it in the private scope here is what I get:
the error: ‘static void helpFunctions:: logger(std::str ing, std::string)’ is private.
If it would help the logger instance that I'm using is a singleton instance.
The reason to put It private is because I have two functions:
So I don't want the user to use a the logger in a potentially wrong way.
thanks,
romand
Just to check, before I had the 2 functions in the second code box I used in the main the logger function and when I got it to be private I haven't erased the lines in the main.
*********
Question:
hello, If you remember me from yesterday, having some problems. I've defined a helpFunctions.c pp class with static functions. now I have a static function that I don't need the user to see so I'm trying to make it private.it works fine as public but once I put it in the private scope here is what I get:
Code:
private:
static void logger(string message, string outputFileName="")
{
Logger& loggerInstance = Logger::getInstance();
if(outputFileName != "")
{
loggerInstance.initialize(outputFileName);
}
else
{
loggerInstance.addMsg(message);
}
}
If it would help the logger instance that I'm using is a singleton instance.
The reason to put It private is because I have two functions:
Code:
static void initialize(string outputFileName)
{
logger("",outputFileName);
}
static void addMsg(string message)
{
logger(message);
}
thanks,
romand
Comment