Permalink
Browse files

Moved logger class to the logging namespace and replaced log4net with…

… NLog.
  • Loading branch information...
coder2000 committed May 16, 2011
1 parent c27d2f2 commit 7a42df81dbd0da458861c4503e4c46d0ed0279d7
View
@@ -47,4 +47,5 @@ _ReSharper*/
ubiety.shfbproj_Dieter
ubiety-xmpp-cert.crt
ubiety-xmpp-priv.key
-ubiety-xmpp.key
+ubiety-xmpp.key
+ubiety.sln.docstates
View
@@ -1,13 +1,5 @@
<?xml version="1.0"?>
<configuration>
- <configSections>
- <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net"/>
- </configSections>
-
- <appSettings>
- <add key="log4net.Internal.Debug" value="true"/>
- </appSettings>
-
<system.diagnostics>
<trace autoflush="true"/>
@@ -35,47 +27,4 @@
</switches>
</system.diagnostics>
- <log4net>
- <appender name="LogFileAppender" type="log4net.Appender.FileAppender">
- <param name="File" value="ubiety.dll.log"/>
- <param name="AppendToFile" value="true"/>
- <layout type="log4net.Layout.PatternLayout">
- <param name="Header" value="[Starting TestXMPP Logging]
-"/>
- <param name="Footer" value="[End Logging]
-
-"/>
- <param name="ConversionPattern" value="%d %-5p %-35c %m%n"/>
- </layout>
- </appender>
-
- <appender name="RichTextAppender" type="log4net.Appender.RichTextBoxAppender, log4net.Appender.RichTextBoxAppender">
- <layout type="log4net.Layout.PatternLayout">
- <param name="Header" value="[Starting TestXMPP Logging]
-"/>
- <param name="Footer" value="[End Logging]
-
-"/>
- <param name="ConversionPattern" value="%d %-5p %-35c %m%n"/>
- </layout>
- <mapping>
- <level value="ERROR"/>
- <textColorName value="Red"/>
- </mapping>
- <mapping>
- <level value="DEBUG"/>
- <textColorName value="Blue"/>
- </mapping>
- <mapping>
- <level value="INFO"/>
- <textColorName value="Orange"/>
- </mapping>
- </appender>
-
- <root>
- <level value="DEBUG"/>
- <appender-ref ref="LogFileAppender"/>
- <appender-ref ref="RichTextAppender"/>
- </root>
- </log4net>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration>
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View
@@ -1,36 +1,34 @@
using System;
+using System.Reflection;
using System.Windows.Forms;
-using log4net.Appender.RichTextBoxAppender;
using ubiety;
using ubiety.common;
+using ubiety.core;
using ubiety.registries;
-using System.Reflection;
-using log4net.Config;
namespace TestXMPP
{
public partial class Main : Form
{
- XMPP _xmpp;
+ private XMPP _xmpp;
public Main()
{
InitializeComponent();
CompressionRegistry.Instance.AddCompression(Assembly.LoadFile(Application.StartupPath + @"\ubiety.compression.sharpziplib.dll"));
Errors.Instance.OnError += Errors_OnError;
- XmlConfigurator.Configure();
slVersion.Text = "Ubiety Version: " + XMPP.Version;
}
- static void Errors_OnError(object sender, ErrorEventArgs e)
+ private static void Errors_OnError(object sender, ErrorEventArgs e)
{
MessageBox.Show(e.Message, "Protocol Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
private void Button1Click(object sender, EventArgs e)
{
_xmpp = new XMPP();
- UbietySettings.AuthenticationTypes = ubiety.core.MechanismType.Default;
+ UbietySettings.AuthenticationTypes = MechanismType.Default;
UbietySettings.Id = new JID(txtUsername.Text);
UbietySettings.Password = txtPassword.Text;
UbietySettings.SSL = btnSSL.Checked;
@@ -39,14 +37,9 @@ private void Button1Click(object sender, EventArgs e)
private void BtnExitClick(object sender, EventArgs e)
{
- if (_xmpp != null)
+ if (_xmpp != null && _xmpp.Connected)
_xmpp.Disconnect();
Application.Exit();
}
-
- private void MainLoad(object sender, EventArgs e)
- {
- RichTextBoxAppender.SetRichTextBox(rtbDebug, "RichTextAppender");
- }
}
}
Oops, something went wrong.

0 comments on commit 7a42df8

Please sign in to comment.