What a great Pittsburgh Tech Fest this year! Lots of great sessions, attendance was awesome and I met lots of like minded folks!
Thanks to everyone that attended my talk on .NET Reactive Extensions! Hopefully everyone was able to walk away with some useful information and maybe some ideas to try!
You can get the slides and code (as presented at Tech Fest) from my GitHub repo here:
Pittsburgh Tech Fest was great this year! It was a perfect opportunity to learn about some different technologies and techniques. I’d like to give a special thanks to Dave and Eric for doing an awesome job organizing the event and the speakers.
For those that are interested, below are the links to the talk I did on iOS Best Practices: Avoid the Bloat and feel free to comment or ask any questions on this post!
Code before refactoring: https://github.com/JAgostoni/iOS-Best-Practices/tree/master/UglyApp
Code after refactoring: https://github.com/JAgostoni/iOS-Best-Practices/tree/master/NotSoUglyApp
Code as presented at Pittsburgh Tech Fest: https://github.com/JAgostoni/iOS-Best-Practices/tree/master/PghTechFest
PowerPoint Slides: iOS Best Practices – Pittsburgh Tech Fest
PDF Slides: iOS Best Practices (PDF) – Pittsburgh Tech Fest
Thanks again to those that attended my talk!
[SNLog Project Page Link]
A simple task that every developer runs into when creating software is proper logging and tracing. What I have found is the simplest solution for logging is always the best.
Requirements are almost always the same:
- Need to log to the console when debugging
- Need to write to a file/database for runtime tracing and diagnostics
There are lots of frameworks for just about every platform out there but logging on the iPhone seemed to be lacking so I decided to create my own as an exercise. Something that would be applicable to my current projects as well as to help out anyone else that might need something like this.
NSLog is the de-facto standard for logging during debugging in Xcode but is primarily temporary scaffolding in your code that needs removed prior to deploying the application. I wanted something as simple to use as NSLog that could be configured to log somewhere more persistent than the console.
The plan of attack on this was straightforward:
- Minimize the files that need included in the project (just two, the .h and .m)
- Make use of it as easy as NSLog
- Re-define NSLog to use the framework instead of the built-in function
- Use a strategy pattern to allow multiple logging mechanisms (console and file built-in)
In addition, I ran into the following additions while I was working on it:
- Don’t let the file logging grow unbounded (especially on a mobile device)
- Capturing the log level/importance can allow different mechanisms to capture the level that is required
So that’s it … in two simple files I was able to create a simple logging mechanism that is a drop-in replacement for NSLog. I can keep all those frivolous NSLog statements in my code and choose where to redirect the log.
Check out the Project Page for more details and the download.