Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A MonoTouch port #20

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
Open

A MonoTouch port #20

wants to merge 16 commits into from

Conversation

adamnation
Copy link

This is a MonoTouch port of the main Common.Logging solution. I was able to reuse most of the code, taking out references to System.Configuration, and System.Diagnostics.Trace in places.

The MonoTouch logger only supports the ConsoleOutLogger, and doesn't support app.config files. Instead it supports a plist file (default is Settings.bundle/Common.Logging.plist).

For the unit tests, I removed System.Configuration and Trace logging as well. All tests pass.

I wasn't sure where to put it in the source tree, so I followed similar patterns as the ServiceStack project.

I plan on using this in my SDK, and will be doing a Droid one as well.

@sbohlen
Copy link
Member

sbohlen commented Jul 13, 2013

Thanks for this pull-request; sorry its taken so long for me to get to review it; as you can see in this thread #35 I've only just recently become aware of some of these pending pull requests and am working to address them ASAP.

I'm attempting to explore this now, but have hit a bit of a blocker (I think!). Can you advise what's actually necessary for me to have installed in order to open this content in VS2012 and/or build it/run the test-suite with this content? Do I need to have an eval copy of the MonoTouch product itself installed, the MonoTouch VS-addin, and/or just the MONO runtime itself?

Also, if its necessary to have the MonoTouch tooling installed (as of now), is it at all possible for you to unwind the dependency on the MonoTouch suite itself and rework this so that it would only have the dependency/pre-requisite for the MONO runtime (vs. the MonoTouch tooling)? Since the MONO runtime is free and the MonoTouch suite isn't (AFAIK), we'd prefer that this pull request take only the dependency on something that others (including me, frankly :P ) could freely install in order to build/test this support directly. Also, am I correct in my assumption that if this were done this way then the work you did would be (generally) usable by any MONO-based project as well as by the MonoTouch users...?

Any help appreciated, and thanks again for the pull-request!

@adamnation
Copy link
Author

Thanks for taking a look!

I just rebased the code, and added the solution with links to the common code, then only added the files required by monotouch to the monotouch folders.

The log for MonoTouch is platform dependant, as is MonoTouch. This is needed since the iPhone reads plist configs and requires native calls to do console logging. For now, you can run this using an eval copy of Xamarin Studio on a Mac.

I'll be working on Mono for Android as well, so I'll see what I can do to make this work without the platform dependencies as you have suggested.

@kaeevans
Copy link

kaeevans commented Aug 7, 2013

I'm trying to use Common.Logging on Mono for Android and I'm also running into all of these problems. Simply removing all references to System.Configuration and using the console logger isn't working for me. Has there been any additional progress?

I know NLog is supposed to be compatible with Mono, so I was hoping that if Common.Logging's console logger was mono compatible, its NLog logger would also be compatible.

@sbohlen
Copy link
Member

sbohlen commented Aug 8, 2013

I've not (yet) been able to test / evaluate this pull request as I've not got (easy) access to a Mac to run the Monotouch dev environment.

At this point, I'm seriously considering perhaps accepting this pull request without any meaningful review/eval of it and somehow flagging it as "use at your own risk" (or similar) since it seems to be a valuable thing to have yet not something for which we're really well-equipped to support/maintain or even review/evaluate.

@Daniel-Svensson
Copy link
Contributor

@adamnation Can see if you can use the portable version of common logging (#30) for mono-touch development? It believe it should be usable with later mono and xamarin releases.

If you require console logging support you would need to add a xamarin/monotouch version of "Common.Logging", you should be able to base it on the silverlight implementation. Just copy the project and make any required changes to make it target monotouch (or create a new project and reference the same files as the silverlight libray).
Also make new project file define some symbol such as MONOTOUCH.

That way you should be able to get monotouch support by only adding a project file and maybe changing the CommonAssemblyInfo.cs file

@angularsen
Copy link

See #73

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants