• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
More on a replacement for the console
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

More on a replacement for the console


  • Subject: More on a replacement for the console
  • From: Alex Zavatone <email@hidden>
  • Date: Mon, 26 Mar 2012 13:48:51 -0400

To get one simple console replacement log window that I can see any time and is not affected whatsoever by Xcode, I am currently using this working solution:

- (void)redirectNSLogToDocumentFolder{
	NSString *documentsDirectory = @"/Users/zav";
	NSString *fileName =[NSString stringWithFormat:@"iPhone Simulator log.txt"];
	NSString *logFilePath = [documentsDirectory stringByAppendingPathComponent:fileName];
	freopen([logFilePath cStringUsingEncoding:NSASCIIStringEncoding],"a+",stderr);
}

I'm calling it on application didFinishLaunchingWithOptions like so:

	 [self redirectNSLogToDocumentFolder ];

This writes to a file at the root of my user folder on my HD only when I am using the simulator.  For now, this is good enough.

The file: ~\iPhone Simulator log.txt

While I'm still looking to get the Terminal (or a terminal replacement) to display proportional fonts with proportional spacing, I'm simply using this to display my log file.

tail -f 'iPhone Simulator log.txt'

The log file gets deleted at the end of each day, whether I want it to or not.

All the output I want without having to worry about when/if Xcode is going to do something odd to my GUI or widow placement.

- Alex Zavatone



 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: upgrading to Xcode 4.3.1
  • Next by Date: Re: upgrading to Xcode 4.3.1
  • Previous by thread: Re: upgrading to Xcode 4.3.1
  • Next by thread: Overriding Methods via Category Now A no-no?
  • Index(es):
    • Date
    • Thread