stop ios ORMMA log output

31 views
Skip to first unread message

Scott D. Yelich

unread,
May 31, 2012, 11:31:54 AM5/31/12
to ORMMA-discussion


I have the ref implementation and am using ORMMA.bundle --
this code seems to spit out far too much log output.

There doesn't seem to be any documentation on how to tell ORMMA to
STFU.

How can I tell the ORMMA.bundle or whatever to not log anything?

Thanks.

Nathan Carver

unread,
May 31, 2012, 2:29:56 PM5/31/12
to ormma-di...@googlegroups.com
Hi Scott,

Glad to hear you are having some success with the reference implementation.

The current iOS ORMMA code directly uses NSLog(@"...") for logging and there's no option to reduce or filter the output.

Maybe you can use one of these workarounds?

1> add this line to your app
   fclose(stderr);
  but this will turn off all logs, includes your own NSLog output

2> modify ORMMA source code based the technique explained here:

Here's a sample macro definition:

#define ERROR 1

#ifdef ERROR
#define ELog(fmt, ...) NSLog((@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__);
#define ILog(...)
#define DLog(...)
#elif INFO
#define ELog(fmt, ...) NSLog((@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__);
#define ILog(fmt, ...) NSLog((@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__);
#define DLog(...)
#elif DEBUG
#define ELog(fmt, ...) NSLog((@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__);
#define ILog(fmt, ...) NSLog((@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__);
#define DLog(fmt, ...) NSLog((@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__);
#else
#define ELog(...)
#define ILog(...)
#define DLog(...)
#endif


Thanks,
-Nathan

Scott D. Yelich

unread,
May 31, 2012, 2:33:46 PM5/31/12
to ormma-di...@googlegroups.com

Hi Nathan --

Thanks for the response.  
I have modified the source code and have been trying to compile for a few hours.
The compiling only makes a .a for armv7 -- so I can't test or build for the simulator.

I'm basically now stepping down the build phase run script now -- line by line -- to
see why it will only make armv7.

Scott
ps: snow leopard, xcode 4.2

Scott D. Yelich

unread,
May 31, 2012, 2:27:45 PM5/31/12
to ORMMA-discussion
Follow up on this after a few hours of banging my head on the desk...

It seems there is some sort of build phase run script that pretty much does something
and does it wrong via xcode 4.2).  

I need to get a libORMMA.a for arm and i386 -- and no matter what settings I configure,
the build system only seems to make armv7.







On Thu, May 31, 2012 at 11:31 AM, Scott D. Yelich <scott...@gmail.com> wrote:

Nathan

unread,
Jun 4, 2012, 3:13:50 PM6/4/12
to ormma-di...@googlegroups.com
Hi Scott,

Not sure if this helps, or if it is too late, but maybe it has to do with choosing the correct libORMMA.a after the ORMMA build.

Below is what we do at Crisp on local and we've not experienced any problems running ORMMA-based apps in simulator or on device:

1> after building ORMMA lib, right click on Products -> libORMMA.a on XCode project's source tree
2> select Show in Finder
3> on libORMMA.a file's parent level, there should be three (or six) folders, make sure to use the one in Debug-universal (or Release-universal)

Thanks,
-Nathan

Scott D. Yelich

unread,
Jun 4, 2012, 3:21:11 PM6/4/12
to ormma-di...@googlegroups.com

that was the issue -- the build product seems to fail due to the build phase run script -- but it seems to make
a fat .a in the build dirs -- just not the build dirs that I configured into xcode.

I wrote a script to grab the arch libs from the build dir and strip out the symbols that cause collisions...

roughly, for each arch:
x "$AR -d $STATIC_LIB AsyncSocket.o" .
x "$AR -d $STATIC_LIB Reachability.o" .

I was then able to change the NSLog to my own macro and now I can enable ORMMA output by section
during runtime by flipping a flag.

I was hoping that since the library was using plain NSLog -- there would be some sort of infoplist or method
call that would disable the output ... otherwise, it's way too chatty with no way to silence without recompiling
(and stripping and lipoing, etc).

Anyway, thanks for all the feedback and suggestions.

Scott
Reply all
Reply to author
Forward
0 new messages