On Sunday, 10 April 2016 at 18:36:19 UTC, Jonathan Villa wrote:
On Sunday, 10 April 2016 at 18:26:57 UTC, Suliman wrote:

Other whay is to leave FileLogger instance in a separated module:
logger.d
public static FileLogger fLogger;

App.d
import logger; //the module
void main()
{
    // generate instance
    logger = new FileLogger("ErrorLog.txt");
}

utils.d
import logger; // the module

foo ()
{
    fLogger...
}

I cannot think in other ways.

JV

FIXING MAIN()
void main()
{
    // generate instance
    fLogger = new FileLogger("ErrorLog.txt");
}


Reply via email to