Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

… NLog.
  • Loading branch information...
commit 7a42df81dbd0da458861c4503e4c46d0ed0279d7 1 parent c27d2f2
@coder2000 coder2000 authored
View
3  .gitignore
@@ -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
51 TestXMPP/App.config
@@ -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
22 TestXMPP/Main.Designer.cs
@@ -38,7 +38,6 @@ private void InitializeComponent()
this.txtUsername = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.txtPassword = new System.Windows.Forms.TextBox();
- this.rtbDebug = new System.Windows.Forms.RichTextBox();
this.toolStrip1.SuspendLayout();
this.statusStrip1.SuspendLayout();
this.SuspendLayout();
@@ -89,7 +88,7 @@ private void InitializeComponent()
//
this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.slVersion});
- this.statusStrip1.Location = new System.Drawing.Point(0, 318);
+ this.statusStrip1.Location = new System.Drawing.Point(0, 72);
this.statusStrip1.Name = "statusStrip1";
this.statusStrip1.Size = new System.Drawing.Size(404, 22);
this.statusStrip1.TabIndex = 1;
@@ -139,24 +138,11 @@ private void InitializeComponent()
this.txtPassword.Size = new System.Drawing.Size(316, 20);
this.txtPassword.TabIndex = 5;
//
- // rtbDebug
- //
- this.rtbDebug.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
- | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.rtbDebug.Font = new System.Drawing.Font("Consolas", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.rtbDebug.Location = new System.Drawing.Point(0, 71);
- this.rtbDebug.Name = "rtbDebug";
- this.rtbDebug.Size = new System.Drawing.Size(404, 244);
- this.rtbDebug.TabIndex = 6;
- this.rtbDebug.Text = "";
- //
// Main
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
- this.ClientSize = new System.Drawing.Size(404, 340);
- this.Controls.Add(this.rtbDebug);
+ this.ClientSize = new System.Drawing.Size(404, 94);
this.Controls.Add(this.txtPassword);
this.Controls.Add(this.label2);
this.Controls.Add(this.txtUsername);
@@ -165,7 +151,6 @@ private void InitializeComponent()
this.Controls.Add(this.toolStrip1);
this.Name = "Main";
this.Text = "TestXMPP";
- this.Load += new System.EventHandler(this.MainLoad);
this.toolStrip1.ResumeLayout(false);
this.toolStrip1.PerformLayout();
this.statusStrip1.ResumeLayout(false);
@@ -186,8 +171,7 @@ private void InitializeComponent()
private System.Windows.Forms.Label label1;
private System.Windows.Forms.TextBox txtUsername;
private System.Windows.Forms.Label label2;
- private System.Windows.Forms.TextBox txtPassword;
- private System.Windows.Forms.RichTextBox rtbDebug;
+ private System.Windows.Forms.TextBox txtPassword;
View
19 TestXMPP/Main.cs
@@ -1,28 +1,26 @@
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);
}
@@ -30,7 +28,7 @@ static void Errors_OnError(object sender, ErrorEventArgs e)
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");
- }
}
}
View
250 TestXMPP/Main.resx
@@ -1,126 +1,126 @@
-<?xml version="1.0" encoding="utf-8"?>
-<root>
- <!--
- Microsoft ResX Schema
-
- Version 2.0
-
- The primary goals of this format is to allow a simple XML format
- that is mostly human readable. The generation and parsing of the
- various data types are done through the TypeConverter classes
- associated with the data types.
-
- Example:
-
- ... ado.net/XML headers & schema ...
- <resheader name="resmimetype">text/microsoft-resx</resheader>
- <resheader name="version">2.0</resheader>
- <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
- <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
- <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
- <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
- <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
- <value>[base64 mime encoded serialized .NET Framework object]</value>
- </data>
- <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
- <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
- <comment>This is a comment</comment>
- </data>
-
- There are any number of "resheader" rows that contain simple
- name/value pairs.
-
- Each data row contains a name, and value. The row also contains a
- type or mimetype. Type corresponds to a .NET class that support
- text/value conversion through the TypeConverter architecture.
- Classes that don't support this are serialized and stored with the
- mimetype set.
-
- The mimetype is used for serialized objects, and tells the
- ResXResourceReader how to depersist the object. This is currently not
- extensible. For a given mimetype the value must be set accordingly:
-
- Note - application/x-microsoft.net.object.binary.base64 is the format
- that the ResXResourceWriter will generate, however the reader can
- read any of the formats listed below.
-
- mimetype: application/x-microsoft.net.object.binary.base64
- value : The object must be serialized with
- : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
- : and then encoded with base64 encoding.
-
- mimetype: application/x-microsoft.net.object.soap.base64
- value : The object must be serialized with
- : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
- : and then encoded with base64 encoding.
-
- mimetype: application/x-microsoft.net.object.bytearray.base64
- value : The object must be serialized into a byte array
- : using a System.ComponentModel.TypeConverter
- : and then encoded with base64 encoding.
- -->
- <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
- <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
- <xsd:element name="root" msdata:IsDataSet="true">
- <xsd:complexType>
- <xsd:choice maxOccurs="unbounded">
- <xsd:element name="metadata">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" />
- </xsd:sequence>
- <xsd:attribute name="name" use="required" type="xsd:string" />
- <xsd:attribute name="type" type="xsd:string" />
- <xsd:attribute name="mimetype" type="xsd:string" />
- <xsd:attribute ref="xml:space" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="assembly">
- <xsd:complexType>
- <xsd:attribute name="alias" type="xsd:string" />
- <xsd:attribute name="name" type="xsd:string" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="data">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
- <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
- <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
- <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
- <xsd:attribute ref="xml:space" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="resheader">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required" />
- </xsd:complexType>
- </xsd:element>
- </xsd:choice>
- </xsd:complexType>
- </xsd:element>
- </xsd:schema>
- <resheader name="resmimetype">
- <value>text/microsoft-resx</value>
- </resheader>
- <resheader name="version">
- <value>2.0</value>
- </resheader>
- <resheader name="reader">
- <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
- </resheader>
- <resheader name="writer">
- <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
- </resheader>
- <metadata name="toolStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
- <value>17, 17</value>
- </metadata>
- <metadata name="statusStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
- <value>122, 17</value>
- </metadata>
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+ <!--
+ Microsoft ResX Schema
+
+ Version 2.0
+
+ The primary goals of this format is to allow a simple XML format
+ that is mostly human readable. The generation and parsing of the
+ various data types are done through the TypeConverter classes
+ associated with the data types.
+
+ Example:
+
+ ... ado.net/XML headers & schema ...
+ <resheader name="resmimetype">text/microsoft-resx</resheader>
+ <resheader name="version">2.0</resheader>
+ <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+ <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+ <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+ <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+ <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+ <value>[base64 mime encoded serialized .NET Framework object]</value>
+ </data>
+ <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+ <comment>This is a comment</comment>
+ </data>
+
+ There are any number of "resheader" rows that contain simple
+ name/value pairs.
+
+ Each data row contains a name, and value. The row also contains a
+ type or mimetype. Type corresponds to a .NET class that support
+ text/value conversion through the TypeConverter architecture.
+ Classes that don't support this are serialized and stored with the
+ mimetype set.
+
+ The mimetype is used for serialized objects, and tells the
+ ResXResourceReader how to depersist the object. This is currently not
+ extensible. For a given mimetype the value must be set accordingly:
+
+ Note - application/x-microsoft.net.object.binary.base64 is the format
+ that the ResXResourceWriter will generate, however the reader can
+ read any of the formats listed below.
+
+ mimetype: application/x-microsoft.net.object.binary.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.soap.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.bytearray.base64
+ value : The object must be serialized into a byte array
+ : using a System.ComponentModel.TypeConverter
+ : and then encoded with base64 encoding.
+ -->
+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+ <xsd:element name="root" msdata:IsDataSet="true">
+ <xsd:complexType>
+ <xsd:choice maxOccurs="unbounded">
+ <xsd:element name="metadata">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="name" use="required" type="xsd:string" />
+ <xsd:attribute name="type" type="xsd:string" />
+ <xsd:attribute name="mimetype" type="xsd:string" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="assembly">
+ <xsd:complexType>
+ <xsd:attribute name="alias" type="xsd:string" />
+ <xsd:attribute name="name" type="xsd:string" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="data">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="resheader">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:choice>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ <resheader name="resmimetype">
+ <value>text/microsoft-resx</value>
+ </resheader>
+ <resheader name="version">
+ <value>2.0</value>
+ </resheader>
+ <resheader name="reader">
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <metadata name="toolStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+ <value>17, 17</value>
+ </metadata>
+ <metadata name="statusStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+ <value>122, 17</value>
+ </metadata>
</root>
View
14 TestXMPP/NLog.config
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+
+ <targets>
+ <target xsi:type="File" name="logfile" fileName="ubiety.log"/>
+ <target xsi:type="RichTextBox" name="textbox" controlName="rtbDebug" formName="Main" useDefaultRowColoringRules="true"/>
+ </targets>
+
+ <rules>
+ <logger name="*" minlevel="Trace" writeTo="logfile"/>
+ <logger name="*" minlevel="Trace" writeTo="textbox"/>
+ </rules>
+</nlog>
View
11 TestXMPP/TestXMPP.csproj
@@ -38,9 +38,7 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
- <Reference Include="log4net">
- <HintPath>..\references\log4net.dll</HintPath>
- </Reference>
+ <Reference Include="NLog, Version=2.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL" />
<Reference Include="System" />
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
@@ -77,6 +75,9 @@
<None Include="App.config">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
+ <None Include="NLog.config">
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ </None>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
@@ -88,10 +89,6 @@
</Compile>
</ItemGroup>
<ItemGroup>
- <ProjectReference Include="..\log4net.Appender.RichTextBoxAppender\log4net.Appender.RichTextBoxAppender.csproj">
- <Project>{E66CB0F8-4300-4FA7-B416-E5387AAB3655}</Project>
- <Name>log4net.Appender.RichTextBoxAppender</Name>
- </ProjectReference>
<ProjectReference Include="..\ubiety.compression.sharpziplib\ubiety.compression.sharpziplib.csproj">
<Project>{13A7D189-9C18-4FBF-BEDC-5A9D6557C693}</Project>
<Name>ubiety.compression.sharpziplib</Name>
View
8 ubiety.sln
@@ -9,8 +9,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ubiety.compression.sharpzip
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ubietynunit", "ubietynunit\ubietynunit.csproj", "{76FB5852-B727-426B-9054-0B580C0B5E5F}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "log4net.Appender.RichTextBoxAppender", "log4net.Appender.RichTextBoxAppender\log4net.Appender.RichTextBoxAppender.csproj", "{E66CB0F8-4300-4FA7-B416-E5387AAB3655}"
-EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -33,16 +31,12 @@ Global
{76FB5852-B727-426B-9054-0B580C0B5E5F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{76FB5852-B727-426B-9054-0B580C0B5E5F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{76FB5852-B727-426B-9054-0B580C0B5E5F}.Release|Any CPU.Build.0 = Release|Any CPU
- {E66CB0F8-4300-4FA7-B416-E5387AAB3655}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {E66CB0F8-4300-4FA7-B416-E5387AAB3655}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {E66CB0F8-4300-4FA7-B416-E5387AAB3655}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {E66CB0F8-4300-4FA7-B416-E5387AAB3655}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
- CodeStyleEnforcer_Active =
CodeStyleEnforcer_RulesLocation =
+ CodeStyleEnforcer_Active =
EndGlobalSection
EndGlobal
View
1  ubiety/ProtocolParser.cs
@@ -22,6 +22,7 @@
using System.IO;
using System.Xml;
using ubiety.common;
+using ubiety.logging;
using ubiety.registries;
using ubiety.states;
using Stream = ubiety.core.Stream;
View
1  ubiety/XMPP.cs
@@ -20,6 +20,7 @@
using System;
using System.Reflection;
using ubiety.common;
+using ubiety.logging;
using ubiety.net;
using ubiety.registries;
using ubiety.states;
View
1  ubiety/common/SASL/MD5Processor.cs
@@ -22,6 +22,7 @@
using System.Xml;
using ubiety.core;
using ubiety.core.SASL;
+using ubiety.logging;
using ubiety.registries;
namespace ubiety.common.SASL
View
1  ubiety/common/SASL/PlainProcessor.cs
@@ -20,6 +20,7 @@
using System.Xml;
using ubiety.core;
using ubiety.core.SASL;
+using ubiety.logging;
using ubiety.registries;
namespace ubiety.common.SASL
View
1  ubiety/common/SASL/SASLProcessor.cs
@@ -20,6 +20,7 @@
using ubiety.core;
using System.Text;
using System.Security.Cryptography;
+using ubiety.logging;
namespace ubiety.common.SASL
{
View
1  ubiety/common/SASL/SCRAMProcessor.cs
@@ -19,6 +19,7 @@
using System.Xml;
using System.Text;
using System.Security.Cryptography;
+using ubiety.logging;
using ubiety.registries;
using ubiety.core.SASL;
using ubiety.core;
View
157 ubiety/Logger.cs → ubiety/logging/Logger.cs
@@ -16,9 +16,9 @@
//Temple Place, Suite 330, Boston, MA 02111-1307 USA
using System;
-using log4net;
+using NLog;
-namespace ubiety
+namespace ubiety.logging
{
/// <summary>
/// A simple logging class that wraps log4net
@@ -29,12 +29,7 @@ private Logger()
{
}
- static Logger()
- {
- //XmlConfigurator.Configure();
- }
-
- #region .: Enabled Checks :.
+ #region .: Enabled Checks :.
/// <summary>
///
@@ -246,9 +241,9 @@ public static bool IsFatalEnabled(string name)
return LogManager.GetLogger(name).IsFatalEnabled;
}
- #endregion
+ #endregion
- #region .: Debug :.
+ #region .: Debug :.
/// <summary>
///
@@ -340,12 +335,12 @@ public static void DebugFormat(Type t, string format, params object[] parameters
/// </param>
public static void DebugFormat(string name, string format, params object[] parameters)
{
- LogManager.GetLogger(name).DebugFormat(format, parameters);
+ LogManager.GetLogger(name).Debug(format, parameters);
}
- #endregion
+ #endregion
- #region .: Info :.
+ #region .: Info :.
/// <summary>
///
@@ -437,12 +432,12 @@ public static void InfoFormat(Type t, string format, params object[] parameters)
/// </param>
public static void InfoFormat(string name, string format, params object[] parameters)
{
- LogManager.GetLogger(name).InfoFormat(format, parameters);
+ LogManager.GetLogger(name).Info(format, parameters);
}
- #endregion
+ #endregion
- #region .: Warn :.
+ #region .: Warn :.
/// <summary>
///
@@ -498,10 +493,10 @@ public static void Warn(string name, object message)
/// <param name="parameters">
/// A <see cref="System.Object"/>
/// </param>
- public static void WarnFormat(object o, string format, params object[] parameters)
- {
- WarnFormat(o.GetType(), format, parameters);
- }
+ public static void WarnFormat(object o, string format, params object[] parameters)
+ {
+ WarnFormat(o.GetType(), format, parameters);
+ }
/// <summary>
///
@@ -515,10 +510,10 @@ public static void WarnFormat(object o, string format, params object[] parameter
/// <param name="parameters">
/// A <see cref="System.Object"/>
/// </param>
- public static void WarnFormat(Type t, string format, params object[] parameters)
- {
- WarnFormat(t.FullName, format, parameters);
- }
+ public static void WarnFormat(Type t, string format, params object[] parameters)
+ {
+ WarnFormat(t.FullName, format, parameters);
+ }
/// <summary>
///
@@ -532,14 +527,14 @@ public static void WarnFormat(Type t, string format, params object[] parameters)
/// <param name="parameters">
/// A <see cref="System.Object"/>
/// </param>
- public static void WarnFormat(string name, string format, params object[] parameters)
- {
- LogManager.GetLogger(name).WarnFormat(format, parameters);
- }
+ public static void WarnFormat(string name, string format, params object[] parameters)
+ {
+ LogManager.GetLogger(name).Warn(format, parameters);
+ }
- #endregion
+ #endregion
- #region .: Error :.
+ #region .: Error :.
/// <summary>
///
@@ -550,10 +545,10 @@ public static void WarnFormat(string name, string format, params object[] parame
/// <param name="message">
/// A <see cref="System.Object"/>
/// </param>
- public static void Error(object o, object message)
- {
- Error(o.GetType(), message);
- }
+ public static void Error(object o, object message)
+ {
+ Error(o.GetType(), message);
+ }
/// <summary>
///
@@ -564,10 +559,10 @@ public static void Error(object o, object message)
/// <param name="message">
/// A <see cref="System.Object"/>
/// </param>
- public static void Error(Type t, object message)
- {
- Error(t.FullName, message);
- }
+ public static void Error(Type t, object message)
+ {
+ Error(t.FullName, message);
+ }
/// <summary>
///
@@ -578,10 +573,10 @@ public static void Error(Type t, object message)
/// <param name="message">
/// A <see cref="System.Object"/>
/// </param>
- public static void Error(string name, object message)
- {
- LogManager.GetLogger(name).Error(message);
- }
+ public static void Error(string name, object message)
+ {
+ LogManager.GetLogger(name).Error(message);
+ }
/// <summary>
///
@@ -595,10 +590,10 @@ public static void Error(string name, object message)
/// <param name="parameters">
/// A <see cref="System.Object"/>
/// </param>
- public static void ErrorFormat(object o, string format, params object[] parameters)
- {
- ErrorFormat(o.GetType(), format, parameters);
- }
+ public static void ErrorFormat(object o, string format, params object[] parameters)
+ {
+ ErrorFormat(o.GetType(), format, parameters);
+ }
/// <summary>
///
@@ -612,10 +607,10 @@ public static void ErrorFormat(object o, string format, params object[] paramete
/// <param name="parameters">
/// A <see cref="System.Object"/>
/// </param>
- public static void ErrorFormat(Type t, string format, params object[] parameters)
- {
- ErrorFormat(t.FullName, format, parameters);
- }
+ public static void ErrorFormat(Type t, string format, params object[] parameters)
+ {
+ ErrorFormat(t.FullName, format, parameters);
+ }
/// <summary>
///
@@ -629,14 +624,14 @@ public static void ErrorFormat(Type t, string format, params object[] parameters
/// <param name="parameters">
/// A <see cref="System.Object"/>
/// </param>
- public static void ErrorFormat(string name, string format, params object[] parameters)
- {
- LogManager.GetLogger(name).ErrorFormat(format, parameters);
- }
+ public static void ErrorFormat(string name, string format, params object[] parameters)
+ {
+ LogManager.GetLogger(name).Error(format, parameters);
+ }
- #endregion
+ #endregion
- #region .: Fatal :.
+ #region .: Fatal :.
/// <summary>
///
@@ -647,10 +642,10 @@ public static void ErrorFormat(string name, string format, params object[] param
/// <param name="message">
/// A <see cref="System.Object"/>
/// </param>
- public static void Fatal(object o, object message)
- {
- Fatal(o.GetType(), message);
- }
+ public static void Fatal(object o, object message)
+ {
+ Fatal(o.GetType(), message);
+ }
/// <summary>
///
@@ -661,10 +656,10 @@ public static void Fatal(object o, object message)
/// <param name="message">
/// A <see cref="System.Object"/>
/// </param>
- public static void Fatal(Type t, object message)
- {
- Fatal(t.FullName, message);
- }
+ public static void Fatal(Type t, object message)
+ {
+ Fatal(t.FullName, message);
+ }
/// <summary>
///
@@ -675,10 +670,10 @@ public static void Fatal(Type t, object message)
/// <param name="message">
/// A <see cref="System.Object"/>
/// </param>
- public static void Fatal(string name, object message)
- {
- LogManager.GetLogger(name).Fatal(message);
- }
+ public static void Fatal(string name, object message)
+ {
+ LogManager.GetLogger(name).Fatal(message);
+ }
/// <summary>
///
@@ -692,10 +687,10 @@ public static void Fatal(string name, object message)
/// <param name="parameters">
/// A <see cref="System.Object"/>
/// </param>
- public static void FatalFormat(object o, string format, params object[] parameters)
- {
- FatalFormat(o.GetType(), format, parameters);
- }
+ public static void FatalFormat(object o, string format, params object[] parameters)
+ {
+ FatalFormat(o.GetType(), format, parameters);
+ }
/// <summary>
///
@@ -709,10 +704,10 @@ public static void FatalFormat(object o, string format, params object[] paramete
/// <param name="parameters">
/// A <see cref="System.Object"/>
/// </param>
- public static void FatalFormat(Type t, string format, params object[] parameters)
- {
- FatalFormat(t.FullName, format, parameters);
- }
+ public static void FatalFormat(Type t, string format, params object[] parameters)
+ {
+ FatalFormat(t.FullName, format, parameters);
+ }
/// <summary>
///
@@ -726,11 +721,11 @@ public static void FatalFormat(Type t, string format, params object[] parameters
/// <param name="parameters">
/// A <see cref="System.Object"/>
/// </param>
- public static void FatalFormat(string name, string format, params object[] parameters)
- {
- LogManager.GetLogger(name).FatalFormat(format, parameters);
- }
+ public static void FatalFormat(string name, string format, params object[] parameters)
+ {
+ LogManager.GetLogger(name).Fatal(format, parameters);
+ }
- #endregion
+ #endregion
}
}
View
1  ubiety/net/Address.cs
@@ -21,6 +21,7 @@
using System.Net;
using System.Net.NetworkInformation;
using System.Net.Sockets;
+using ubiety.logging;
using ubiety.net.dns;
namespace ubiety.net
View
1  ubiety/net/AsyncSocket.cs
@@ -27,6 +27,7 @@
using System.Threading;
using ICSharpCode.SharpZipLib.Zip.Compression;
using ubiety.common;
+using ubiety.logging;
using ubiety.states;
namespace ubiety.net
View
1  ubiety/registries/CompressionRegistry.cs
@@ -20,6 +20,7 @@
using System.IO;
using System.Reflection;
using ubiety.common;
+using ubiety.logging;
namespace ubiety.registries
{
View
1  ubiety/registries/TagRegistry.cs
@@ -20,6 +20,7 @@
using System.Xml;
using ubiety.attributes;
using ubiety.common;
+using ubiety.logging;
namespace ubiety.registries
{
View
1  ubiety/states/BindingState.cs
@@ -18,6 +18,7 @@
using ubiety.common;
using ubiety.core;
using ubiety.core.iq;
+using ubiety.logging;
namespace ubiety.states
{
View
1  ubiety/states/ClosedState.cs
@@ -16,6 +16,7 @@
//Temple Place, Suite 330, Boston, MA 02111-1307 USA
using ubiety.common;
+using ubiety.logging;
namespace ubiety.states
{
View
1  ubiety/states/CompressedState.cs
@@ -16,6 +16,7 @@
//Temple Place, Suite 330, Boston, MA 02111-1307 USA
using ubiety.common;
+using ubiety.logging;
namespace ubiety.states
{
View
1  ubiety/states/SASLState.cs
@@ -16,6 +16,7 @@
//Temple Place, Suite 330, Boston, MA 02111-1307 USA
using ubiety.common;
+using ubiety.logging;
namespace ubiety.states
{
View
1  ubiety/states/ServerFeaturesState.cs
@@ -19,6 +19,7 @@
using ubiety.common;
using ubiety.common.SASL;
using ubiety.core;
+using ubiety.logging;
using ubiety.registries;
namespace ubiety.states
View
10 ubiety/ubiety.csproj
@@ -56,8 +56,8 @@
<DocumentationFile>xmpp.xml</DocumentationFile>
</PropertyGroup>
<ItemGroup>
- <Reference Include="log4net">
- <HintPath>..\references\log4net.dll</HintPath>
+ <Reference Include="NLog, Version=2.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
+ <HintPath>..\..\..\..\..\..\..\Program Files (x86)\NLog\.NET Framework 3.5\NLog.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Xml" />
@@ -78,7 +78,7 @@
<Compile Include="common\JID.cs" />
<Compile Include="core\Bind.cs" />
<Compile Include="core\Compression\Compression.cs" />
- <Compile Include="core\entity\C.cs" />
+ <Compile Include="core\disco\C.cs" />
<Compile Include="core\Features.cs" />
<Compile Include="core\GenericTag.cs" />
<Compile Include="core\iq\Iq.cs" />
@@ -100,7 +100,7 @@
<Compile Include="idn\RFC3454.cs" />
<Compile Include="idn\Stringprep.cs" />
<Compile Include="idn\StringprepException.cs" />
- <Compile Include="Logger.cs" />
+ <Compile Include="logging\Logger.cs" />
<Compile Include="net\Address.cs" />
<Compile Include="net\AsyncSocket.cs" />
<Compile Include="net\compression\Checksums\Adler32.cs" />
@@ -187,7 +187,7 @@
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<ProjectExtensions>
<VisualStudio>
- <UserProperties BuildVersion_UpdateFileVersion="True" BuildVersion_StartDate="2010/9/18" BuildVersion_BuildVersioningStyle="None.None.MonthAndDayStamp.Increment" BuildVersion_UpdateAssemblyVersion="True" />
+ <UserProperties BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.None.MonthAndDayStamp.Increment" BuildVersion_StartDate="2010/9/18" BuildVersion_UpdateFileVersion="True" />
</VisualStudio>
</ProjectExtensions>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Please sign in to comment.
Something went wrong with that request. Please try again.