Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7002423
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T20:55:34+00:00 2026-05-27T20:55:34+00:00

Many iOS developers have found the Cocoa Lumberjack Logging framework to fill a need

  • 0

Many iOS developers have found the Cocoa Lumberjack Logging framework to fill a need that simple NSLog statements don’t. It’s reminiscent of Log4J in the Java world.

In any event, I have written my own custom formatter for Lumberjack, but what I don’t see is any documentation on how to flush log statements immediately.

For example, if I’m walking through the debugger and I hit an NSLog() statement, it flushes the log statement to the console immediately. That’s the behavior I’d like to get from a DDLogVerbose() call in Lumberjack.

Right now, I go back and change these statements to NSLog() statements if I want them to spit out immediately as I’m debugging a segment of code. With Lumberjack being so robust, I got to think there’s a way to configure it to flush with no delay.

Anyone know how to make it so?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T20:55:35+00:00Added an answer on May 27, 2026 at 8:55 pm

    I found the answer in the DDLog.h file. Lumberjack has the concept of asynchronous and synchronous logging. At initial read, it didn’t hit me as to what this was for.

    Basically, if you want the log statement to be output in sequence, one needs to make it synchronized (though, as Mike mentioned, this will slow down performance). So, this should only be done in a debugging situation. Ideally, I’ll put another header together and/or some other pre-processor macro to ensure I don’t leave the switch flipped on as synchronous.

    Here’s what you do:

    1. Open up DDLog.h
    2. Go to the line with #define LOG_ASYNC_ENABLED YES. You can change this to NO in one spot for synchronous logging across the board, or you can change individual levels, in the lines that follow.

    Note that the header discourages changing the DDLog.h file itself. So, following the instructions on the Lumberjack wiki page link, they explain how to use a different header file to articulate these override customizations.

    Using that, here’s what I’ve successfully written and tested, as “MyAppLumberjack.h” header file that I import in my app’s precompiled header:

    #import "DDLog.h"
    #import "DDASLLogger.h"
    #import "DDTTYLogger.h"
    
    // ========================= Overrides ========================================
    // --> per https://github.com/robbiehanson/CocoaLumberjack/wiki/CustomLogLevels
    // ----------------------------------------------------------------------------
    
    // Are we in an optimized (i.e. Release) build?
    #ifdef __OPTIMIZE__
        // YES: Nothing to do from the default. (You could simplify this by using #ifndef above instead)
    #else
        // NO: We're in a Debug build. As such, let's configure logging to flush right away.
        // Undefine the asynchronous defaults:
        #undef LOG_ASYNC_VERBOSE
        #undef LOG_ASYNC_INFO
        #undef LOG_ASYNC_WARN
    
        // Define the logs levels to be synchronous:
        #define LOG_ASYNC_VERBOSE   (NO && LOG_ASYNC_ENABLED)   // Debug logging will be synchronous
        #define LOG_ASYNC_INFO      (NO && LOG_ASYNC_ENABLED)   // Info logging will be synchronous
        #define LOG_ASYNC_WARN      (NO && LOG_ASYNC_ENABLED)   // Warn logging will be synchronous
    #endif
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have seen many developers that add various convenience macros to the Prefix.pch of
I'm currently writing an iOS app and I have many records that I'm writing
Many times I have seen Visual Studio solutions which have multiple projects that share
Many applications have grids that display data from a database table one page at
I have an iOS app where you can drag many images and rotate them.
I have been browsing these iOS Cocoa controls and looking to test out a
My company has an iOS developer license, and like many others we have reached
I, like many developers, got an email from Apple recently that stated we should
Many of us have used Perfmon tool to do performance analysis. Especially with .Net
Many websites have the concept of sending messages from user to user. When you

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.