NSLog?

Discussion and announcements regarding the Mac port… er, original version of Oolite.

Moderators: winston, another_commander

Post Reply
colinh
Average
Average
Posts: 10
Joined: Fri Jan 14, 2011 1:18 am

NSLog?

Post by colinh »

NSLog doesn't work the way it should.

That may have something to do with the OOLog* stuff.

However, that's about 2.3 THOUSAND lines of code, which I don't really want to go through! I just want to use NSLog.

I saw some #undef NSLog code, but when I try that I get no output either.

*grump*
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6683
Joined: Wed Feb 28, 2007 7:54 am

Re: NSLog?

Post by another_commander »

colinh wrote:
NSLog doesn't work the way it should.

That may have something to do with the OOLog* stuff.

However, that's about 2.3 THOUSAND lines of code, which I don't really want to go through! I just want to use NSLog.

I saw some #undef NSLog code, but when I try that I get no output either.

*grump*
I am not working on a Mac, but although I don't see why NSLog() would fail, maybe you can use OOLog() for what you need to do? OOLog works in a similar way to NSLog, only instead of [b]NSLog(@"This is a message");[/b] you would use [b]OOLog(@"LogClassOfMyMessage", @"This is a message");[/b].
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Re: NSLog?

Post by JensAyton »

NSLogs will turn up in the log as “[unclassified]” messages if you’ve included OOLogging.h, and “[system]” messages if you call the real NSLog. (In GNUstep builds, real NSLog calls are labelled “[gnustep]”.)

I suspect that what you really want is to see log messages in the Xcode console, which you can get with defaults write org.aegidian.oolite [url=http://wiki.alioth.net/index.php/Hidden_Settings_in_Oolite]logging-echo-to-stderr[/url] -bool true in the terminal. (Or select “Echo log to stderr” in Secrets.prefpane.)
Last edited by JensAyton on Tue Jan 18, 2011 2:42 pm, edited 1 time in total.
Reason: Corrected defaults command params.
colinh
Average
Average
Posts: 10
Joined: Fri Jan 14, 2011 1:18 am

Re: NSLog?

Post by colinh »

I suspect that what you really want is to see log messages in the Xcode console
Yes, thanks, that's what I wanted.


And thanks for the link to the Secret Hidden Settings page!

I hadn't even found/looked for the Elite Wiki :-)

Just out of interest, is the Hidden Settings Page linked to from the Oolite Main Page? I didn't see it offhand :-) But then, it wouldn't be much of a hidden secret hidden settings page, if it were... :mrgreen:


Key: logging-echo-to-stderr
Type: boolean
Default: NO
If set to YES, log messages are written to the standard error output as well as the log file.

NSLogs will turn up in the log as “[unclassified]” messages if you’ve included OOLogging.h, and “[system]” messages if you call the real NSLog.
I know it must look like I'm being deliberately thick/lazy, (it's always like that when getting into a new project :-( ) but, where is this log file? I've looked in ~, /, /var/log/, ~/Documents, ~/oolite-saves and a bit in ~/developer/oolite/ and /opt/var/local...
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Re: NSLog?

Post by JensAyton »

colinh wrote:
I know it must look like I'm being deliberately thick/lazy, (it's always like that when getting into a new project :-( ) but, where is this log file? I've looked in ~, /, /var/log/, ~/Documents, ~/oolite-saves and a bit in ~/developer/oolite/ and /opt/var/local...
~/Library/Logs/Oolite/Latest.log. Or Show Log in the debug menu. :-)
User avatar
Commander McLane
---- E L I T E ----
---- E L I T E ----
Posts: 9520
Joined: Thu Dec 14, 2006 9:08 am
Location: a Hacker Outpost in a moderately remote area
Contact:

Re: NSLog?

Post by Commander McLane »

colinh wrote:
Just out of interest, is the Hidden Settings Page linked to from the Oolite Main Page? I didn't see it offhand :-)
You could try the link to Hidden Settings in Oolite from the Oolite Main Index. :wink:
Post Reply