# Logger::writeToLog in Debug mode

**URL:** <https://forum.juce.com/t/logger-writetolog-in-debug-mode/7175>\
**Category:** General JUCE discussion\
**Created:** [July 18, 2011, 11:31am UTC](https://forum.juce.com/t/logger-writetolog-in-debug-mode/7175 "2011-07-18T11:31:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shlomi](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/shlomi/32/99_2.png) [@Shlomi](https://forum.juce.com/u/Shlomi)\
**Post date:** [July 18, 2011, 11:31am UTC](https://forum.juce.com/t/logger-writetolog-in-debug-mode/7175/1 "2011-07-18T11:31:30Z")

</div>

Hi.

I’m using the fileLogger to record logs in my app.  
I have some audio callbacks and sometimes I turn on logs to see what’s going on.

The thing is that when I don’t want to use logs in debug mode, I can’t really get rid of them:

```auto
void Logger::writeToLog (const String& message)
{
    if (currentLogger != nullptr)
        currentLogger->logMessage (message);
    else
        outputDebugString (message); 
}
```

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [July 18, 2011, 11:57am UTC](https://forum.juce.com/t/logger-writetolog-in-debug-mode/7175/2 "2011-07-18T11:57:32Z")

</div>

Well, the best solution would be to use a macro or intermediate function instead of calling the logger directly, then you can make it do whatever you want.
