Refactor code
authorWonYoung Choi <wy80.choi@samsung.com>
Wed, 9 Mar 2016 14:19:42 +0000 (23:19 +0900)
committerWonYoung Choi <wy80.choi@samsung.com>
Wed, 9 Mar 2016 14:22:23 +0000 (23:22 +0900)
Change-Id: I7a3f7eaee9d13359add0b5416cf1f23675f4c78c

12 files changed:
.gitattributes [new file with mode: 0755]
.gitignore
Tizen.sln [new file with mode: 0755]
packaging/csapi-tizen.spec
src/Tizen/Interop/Interop.Dlog.cs [new file with mode: 0755]
src/Tizen/NativeMethods.cs [deleted file]
src/Tizen/Properties/AssemblyInfo.cs [moved from Properties/AssemblyInfo.cs with 86% similarity]
src/Tizen/Tizen.csproj [moved from tizen.csproj with 86% similarity]
src/Tizen/Tizen.csproj.user [new file with mode: 0755]
src/Tizen/Tizen.snk [moved from Tizen.snk with 100% similarity]
src/Tizen/Tizen/Log.cs [moved from src/Tizen/Log.cs with 77% similarity]
src/Tizen/Tizen/LogTraceListener.cs [moved from src/Tizen/LogTraceListener.cs with 77% similarity]

diff --git a/.gitattributes b/.gitattributes
new file mode 100755 (executable)
index 0000000..1ff0c42
--- /dev/null
@@ -0,0 +1,63 @@
+###############################################################################
+# Set default behavior to automatically normalize line endings.
+###############################################################################
+* text=auto
+
+###############################################################################
+# Set default behavior for command prompt diff.
+#
+# This is need for earlier builds of msysgit that does not have it on by
+# default for csharp files.
+# Note: This is only used by command line
+###############################################################################
+#*.cs     diff=csharp
+
+###############################################################################
+# Set the merge driver for project and solution files
+#
+# Merging from the command prompt will add diff markers to the files if there
+# are conflicts (Merging from VS is not affected by the settings below, in VS
+# the diff markers are never inserted). Diff markers may cause the following 
+# file extensions to fail to load in VS. An alternative would be to treat
+# these files as binary and thus will always conflict and require user
+# intervention with every merge. To do so, just uncomment the entries below
+###############################################################################
+#*.sln       merge=binary
+#*.csproj    merge=binary
+#*.vbproj    merge=binary
+#*.vcxproj   merge=binary
+#*.vcproj    merge=binary
+#*.dbproj    merge=binary
+#*.fsproj    merge=binary
+#*.lsproj    merge=binary
+#*.wixproj   merge=binary
+#*.modelproj merge=binary
+#*.sqlproj   merge=binary
+#*.wwaproj   merge=binary
+
+###############################################################################
+# behavior for image files
+#
+# image files are treated as binary by default.
+###############################################################################
+#*.jpg   binary
+#*.png   binary
+#*.gif   binary
+
+###############################################################################
+# diff behavior for common document formats
+# 
+# Convert binary document formats to text before diffing them. This feature
+# is only available from the command line. Turn it on by uncommenting the 
+# entries below.
+###############################################################################
+#*.doc   diff=astextplain
+#*.DOC   diff=astextplain
+#*.docx  diff=astextplain
+#*.DOCX  diff=astextplain
+#*.dot   diff=astextplain
+#*.DOT   diff=astextplain
+#*.pdf   diff=astextplain
+#*.PDF   diff=astextplain
+#*.rtf   diff=astextplain
+#*.RTF   diff=astextplain
index 7d84484..8fd3218 100644 (file)
@@ -2,3 +2,4 @@ bin/
 obj/
 *.exe
 *.dll
+.vs/
diff --git a/Tizen.sln b/Tizen.sln
new file mode 100755 (executable)
index 0000000..3ef5a12
--- /dev/null
+++ b/Tizen.sln
@@ -0,0 +1,22 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 14
+VisualStudioVersion = 14.0.24720.0
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tizen", "Tizen\Tizen.csproj", "{7659CA59-410D-41A1-9841-586E88BC78C9}"
+EndProject
+Global
+       GlobalSection(SolutionConfigurationPlatforms) = preSolution
+               Debug|Any CPU = Debug|Any CPU
+               Release|Any CPU = Release|Any CPU
+       EndGlobalSection
+       GlobalSection(ProjectConfigurationPlatforms) = postSolution
+               {7659CA59-410D-41A1-9841-586E88BC78C9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+               {7659CA59-410D-41A1-9841-586E88BC78C9}.Debug|Any CPU.Build.0 = Debug|Any CPU
+               {7659CA59-410D-41A1-9841-586E88BC78C9}.Release|Any CPU.ActiveCfg = Release|Any CPU
+               {7659CA59-410D-41A1-9841-586E88BC78C9}.Release|Any CPU.Build.0 = Release|Any CPU
+       EndGlobalSection
+       GlobalSection(SolutionProperties) = preSolution
+               HideSolutionNode = FALSE
+       EndGlobalSection
+EndGlobal
index 39ae4a3..19ebe13 100644 (file)
@@ -47,11 +47,10 @@ cp %{SOURCE1} .
 
 %build
 # build dll
-mcs -target:library -out:%{dllname} -keyfile:Tizen.snk \
-  Properties/AssemblyInfo.cs \
-  Tizen/Log.cs \
-  Tizen/LogTraceListener.cs \
-  Tizen/NativeMethods.cs
+mcs -target:library -out:%{dllname} -keyfile:Tizen/Tizen.snk \
+  Tizen/Properties/AssemblyInfo.cs \
+  Tizen/Tizen/*.cs \
+  Tizen/Interop/*.cs
 
 # check p/invoke
 if [ -x %{dllname} ]; then
diff --git a/src/Tizen/Interop/Interop.Dlog.cs b/src/Tizen/Interop/Interop.Dlog.cs
new file mode 100755 (executable)
index 0000000..71bdef4
--- /dev/null
@@ -0,0 +1,41 @@
+/// Copyright 2016 by Samsung Electronics, Inc.,
+///
+/// This software is the confidential and proprietary information
+/// of Samsung Electronics, Inc. ("Confidential Information"). You
+/// shall not disclose such Confidential Information and shall use
+/// it only in accordance with the terms of the license agreement
+/// you entered into with Samsung.
+
+
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+    internal static partial class Libraries
+    {
+        public const string Dlog = "libdlog.so.0";
+    }
+
+    internal static partial class Dlog
+    {
+        internal enum LogPriority
+        {
+            DLOG_UNKNOWN = 0,
+            DLOG_DEFAULT,
+            DLOG_VERBOSE,
+            DLOG_DEBUG,
+            DLOG_INFO,
+            DLOG_WARN,
+            DLOG_ERROR,
+            DLOG_FATAL,
+            DLOG_SILENT,
+            DLOG_PRIO_MAX,
+        }
+        [DllImportAttribute(Libraries.Dlog, EntryPoint = "dlog_print", CallingConvention = CallingConvention.Cdecl)]
+        internal static extern int Print(LogPriority prio, string tag, string fmt, string msg);
+
+        [DllImportAttribute(Libraries.Dlog, EntryPoint = "dlog_print", CallingConvention = CallingConvention.Cdecl)]
+        internal static extern int Print(LogPriority prio, string tag, string fmt, string file, string func, int line, string msg);
+    }
+}
+
diff --git a/src/Tizen/NativeMethods.cs b/src/Tizen/NativeMethods.cs
deleted file mode 100755 (executable)
index b3d3b65..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-using System;\r
-using System.Collections.Generic;\r
-using System.Linq;\r
-using System.Text;\r
-using System.Threading.Tasks;\r
-using System.Runtime.InteropServices;\r
-\r
-namespace Tizen\r
-{\r
-    internal static class NativeMethods\r
-    {\r
-        internal enum LogPriority\r
-        {\r
-            DLOG_UNKNOWN = 0,\r
-            DLOG_DEFAULT,\r
-            DLOG_VERBOSE,\r
-            DLOG_DEBUG,\r
-            DLOG_INFO,\r
-            DLOG_WARN,\r
-            DLOG_ERROR,\r
-            DLOG_FATAL,\r
-            DLOG_SILENT,\r
-            DLOG_PRIO_MAX,\r
-        }\r
-        [DllImportAttribute("libdlog.so.0", EntryPoint = "dlog_print", CallingConvention = CallingConvention.Cdecl)]\r
-        internal static extern int DlogPrint(LogPriority prio, string tag, string fmt, string msg);\r
-\r
-        [DllImportAttribute("libdlog.so.0", EntryPoint = "dlog_print", CallingConvention = CallingConvention.Cdecl)]\r
-        internal static extern int DlogPrint(LogPriority prio, string tag, string fmt, string file, string func, int line, string msg);\r
-    }\r
-}\r
similarity index 86%
rename from Properties/AssemblyInfo.cs
rename to src/Tizen/Properties/AssemblyInfo.cs
index dc0c870..44daf40 100755 (executable)
@@ -1,19 +1,18 @@
-using System.Reflection;\r
-using System.Runtime.CompilerServices;\r
-using System.Runtime.InteropServices;\r
-\r
-[assembly: AssemblyTitle("Tizen")]\r
-[assembly: AssemblyDescription("")]\r
-[assembly: AssemblyConfiguration("")]\r
-[assembly: AssemblyCompany("Samsung Electronics")]\r
-[assembly: AssemblyProduct("Tizen")]\r
-[assembly: AssemblyCopyright("Copyright (c) 2015 Samsung Electronics Co., Ltd")]\r
-[assembly: AssemblyTrademark("")]\r
-[assembly: AssemblyCulture("")]\r
-\r
-[assembly: ComVisible(false)]\r
-\r
-[assembly: Guid("8aa94469-cdb5-4d8c-81d0-df4590eea612")]\r
-\r
-[assembly: AssemblyVersion("1.0.0.0")]\r
-[assembly: AssemblyFileVersion("1.0.0.0")]\r
+using System.Reflection;
+using System.Runtime.InteropServices;
+
+[assembly: AssemblyTitle("Tizen")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("Samsung Electronics")]
+[assembly: AssemblyProduct("Tizen")]
+[assembly: AssemblyCopyright("Copyright (c) 2015 Samsung Electronics Co., Ltd")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+[assembly: ComVisible(false)]
+
+[assembly: Guid("8aa94469-cdb5-4d8c-81d0-df4590eea612")]
+
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
similarity index 86%
rename from tizen.csproj
rename to src/Tizen/Tizen.csproj
index 7b1b546..cc3e3ff 100755 (executable)
@@ -1,68 +1,65 @@
-<?xml version="1.0" encoding="utf-8"?>\r
-<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
-  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />\r
-  <PropertyGroup>\r
-    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
-    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>\r
-    <ProjectGuid>{8AA94469-CDB5-4D8C-81D0-DF4590EEA612}</ProjectGuid>\r
-    <OutputType>Library</OutputType>\r
-    <AppDesignerFolder>Properties</AppDesignerFolder>\r
-    <RootNamespace>\r
-    </RootNamespace>\r
-    <AssemblyName>Tizen</AssemblyName>\r
-    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
-    <FileAlignment>512</FileAlignment>\r
-    <TargetFrameworkProfile />\r
-  </PropertyGroup>\r
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
-    <DebugSymbols>true</DebugSymbols>\r
-    <DebugType>full</DebugType>\r
-    <Optimize>false</Optimize>\r
-    <OutputPath>bin\Debug\</OutputPath>\r
-    <DefineConstants>DEBUG;TRACE</DefineConstants>\r
-    <ErrorReport>prompt</ErrorReport>\r
-    <WarningLevel>4</WarningLevel>\r
-    <DocumentationFile>bin\Debug\Tizen.XML</DocumentationFile>\r
-  </PropertyGroup>\r
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">\r
-    <DebugType>pdbonly</DebugType>\r
-    <Optimize>true</Optimize>\r
-    <OutputPath>bin\Release\</OutputPath>\r
-    <DefineConstants>TRACE</DefineConstants>\r
-    <ErrorReport>prompt</ErrorReport>\r
-    <WarningLevel>4</WarningLevel>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
-    <SignAssembly>true</SignAssembly>\r
-  </PropertyGroup>\r
-  <PropertyGroup>\r
-    <AssemblyOriginatorKeyFile>Tizen.snk</AssemblyOriginatorKeyFile>\r
-  </PropertyGroup>\r
-  <ItemGroup>\r
-    <Reference Include="System" />\r
-    <Reference Include="System.Core" />\r
-    <Reference Include="System.Xml.Linq" />\r
-    <Reference Include="System.Data.DataSetExtensions" />\r
-    <Reference Include="Microsoft.CSharp" />\r
-    <Reference Include="System.Data" />\r
-    <Reference Include="System.Net.Http" />\r
-    <Reference Include="System.Xml" />\r
-  </ItemGroup>\r
-  <ItemGroup>\r
-    <Compile Include="Tizen\NativeMethods.cs" />\r
-    <Compile Include="Tizen\LogTraceListener.cs" />\r
-    <Compile Include="Tizen\Log.cs" />\r
-    <Compile Include="Properties\AssemblyInfo.cs" />\r
-  </ItemGroup>\r
-  <ItemGroup>\r
-    <None Include="Tizen.snk" />\r
-  </ItemGroup>\r
-  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />\r
-  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \r
-       Other similar extension points exist, see Microsoft.Common.targets.\r
-  <Target Name="BeforeBuild">\r
-  </Target>\r
-  <Target Name="AfterBuild">\r
-  </Target>\r
-  -->\r
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProjectGuid>{7659CA59-410D-41A1-9841-586E88BC78C9}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>Tizen</RootNamespace>
+    <AssemblyName>Tizen</AssemblyName>
+    <TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup>
+    <SignAssembly>true</SignAssembly>
+  </PropertyGroup>
+  <PropertyGroup>
+    <AssemblyOriginatorKeyFile>Tizen.snk</AssemblyOriginatorKeyFile>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="System" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.Xml.Linq" />
+    <Reference Include="System.Data.DataSetExtensions" />
+    <Reference Include="Microsoft.CSharp" />
+    <Reference Include="System.Data" />
+    <Reference Include="System.Net.Http" />
+    <Reference Include="System.Xml" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="Interop\Interop.Dlog.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+    <Compile Include="Tizen\Log.cs" />
+    <Compile Include="Tizen\LogTraceListener.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="Tizen.snk" />
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
+       Other similar extension points exist, see Microsoft.Common.targets.
+  <Target Name="BeforeBuild">
+  </Target>
+  <Target Name="AfterBuild">
+  </Target>
+  -->
 </Project>
\ No newline at end of file
diff --git a/src/Tizen/Tizen.csproj.user b/src/Tizen/Tizen.csproj.user
new file mode 100755 (executable)
index 0000000..ca1d04b
--- /dev/null
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <ProjectView>ProjectFiles</ProjectView>
+  </PropertyGroup>
+</Project>
\ No newline at end of file
similarity index 100%
rename from Tizen.snk
rename to src/Tizen/Tizen.snk
similarity index 77%
rename from src/Tizen/Log.cs
rename to src/Tizen/Tizen/Log.cs
index c0f8170..1ade4e4 100755 (executable)
-using System;\r
-using System.IO;\r
-using System.Runtime.CompilerServices;\r
-\r
-namespace Tizen\r
-{\r
-    /// <summary>\r
-    /// Provides methods to print log messages to Tizen logging system.\r
-    /// </summary>\r
-    public class Log\r
-    {\r
-        /// <summary>\r
-        /// Prints a log message with the DEBUG priority.\r
-        /// </summary>\r
-        /// <param name="tag">The tag name of the log message.</param>\r
-        /// <param name="msg">The log message to print.</param>\r
-        /// <param name="file">The source file path of the caller function. This argument will be set automatically by the compiler.</param>\r
-        /// <param name="func">The function name of caller function. This argument will be set automatically by the compiler.</param>\r
-        /// <param name="line">The line number of calling position. This argument will be set automatically by the compiler.</param>\r
-        public static void Debug(string tag, string msg, [CallerFilePath] string file = "", [CallerMemberName] string func = "", [CallerLineNumber] int line = 0)\r
-        {\r
-            if (String.IsNullOrEmpty(file))\r
-            {\r
-                NativeMethods.DlogPrint(NativeMethods.LogPriority.DLOG_DEBUG, tag, "%s", msg);\r
-            }\r
-            else\r
-            {\r
-                Uri f = new Uri(file);\r
-                NativeMethods.DlogPrint(NativeMethods.LogPriority.DLOG_DEBUG, tag, "%s: %s(%d) > %s", Path.GetFileName(f.AbsolutePath), func, line, msg);\r
-            }\r
-        }\r
-\r
-        /// <summary>\r
-        /// Prints a log message with the VERBOSE priority.\r
-        /// </summary>\r
-        /// <param name="tag">The tag name of the log message.</param>\r
-        /// <param name="msg">The log message to print.</param>\r
-        /// <param name="file">The source file path of the caller function. This argument will be set automatically by the compiler.</param>\r
-        /// <param name="func">The function name of caller function. This argument will be set automatically by the compiler.</param>\r
-        /// <param name="line">The line number of calling position. This argument will be set automatically by the compiler.</param>\r
-        public static void Verbose(string tag, string msg, [CallerFilePath] string file = "", [CallerMemberName] string func = "", [CallerLineNumber] int line = 0)\r
-        {\r
-            if (String.IsNullOrEmpty(file))\r
-            {\r
-                NativeMethods.DlogPrint(NativeMethods.LogPriority.DLOG_VERBOSE, tag, "%s", msg);\r
-            }\r
-            else\r
-            {\r
-                Uri f = new Uri(file);\r
-                NativeMethods.DlogPrint(NativeMethods.LogPriority.DLOG_VERBOSE, tag, "%s: %s(%d) > %s", Path.GetFileName(f.AbsolutePath), func, line, msg);\r
-            }\r
-        }\r
-\r
-        /// <summary>\r
-        /// Prints a log message with the INFO priority.\r
-        /// </summary>\r
-        /// <param name="tag">The tag name of the log message.</param>\r
-        /// <param name="msg">The log message to print.</param>\r
-        /// <param name="file">The source file path of the caller function. This argument will be set automatically by the compiler.</param>\r
-        /// <param name="func">The function name of caller function. This argument will be set automatically by the compiler.</param>\r
-        /// <param name="line">The line number of calling position. This argument will be set automatically by the compiler.</param>\r
-        public static void Info(string tag, string msg, [CallerFilePath] string file = "", [CallerMemberName] string func = "", [CallerLineNumber] int line = 0)\r
-        {\r
-            if (String.IsNullOrEmpty(file))\r
-            {\r
-                NativeMethods.DlogPrint(NativeMethods.LogPriority.DLOG_INFO, tag, "%s", msg);\r
-            }\r
-            else\r
-            {\r
-                Uri f = new Uri(file);\r
-                NativeMethods.DlogPrint(NativeMethods.LogPriority.DLOG_INFO, tag, "%s: %s(%d) > %s", Path.GetFileName(f.AbsolutePath), func, line, msg);\r
-            }\r
-        }\r
-\r
-        /// <summary>\r
-        /// Prints a log message with the WARNING priority.\r
-        /// </summary>\r
-        /// <param name="tag">The tag name of the log message.</param>\r
-        /// <param name="msg">The log message to print.</param>\r
-        /// <param name="file">The source file path of the caller function. This argument will be set automatically by the compiler.</param>\r
-        /// <param name="func">The function name of caller function. This argument will be set automatically by the compiler.</param>\r
-        /// <param name="line">The line number of calling position. This argument will be set automatically by the compiler.</param>\r
-        public static void Warn(string tag, string msg, [CallerFilePath] string file = "", [CallerMemberName] string func = "", [CallerLineNumber] int line = 0)\r
-        {\r
-            if (String.IsNullOrEmpty(file))\r
-            {\r
-                NativeMethods.DlogPrint(NativeMethods.LogPriority.DLOG_WARN, tag, "%s", msg);\r
-            }\r
-            else\r
-            {\r
-                Uri f = new Uri(file);\r
-                NativeMethods.DlogPrint(NativeMethods.LogPriority.DLOG_WARN, tag, "%s: %s(%d) > %s", Path.GetFileName(f.AbsolutePath), func, line, msg);\r
-            }\r
-        }\r
-\r
-        /// <summary>\r
-        /// Prints a log message with the ERROR priority.\r
-        /// </summary>\r
-        /// <param name="tag">The tag name of the log message.</param>\r
-        /// <param name="msg">The log message to print.</param>\r
-        /// <param name="file">The source file path of the caller function. This argument will be set automatically by the compiler.</param>\r
-        /// <param name="func">The function name of caller function. This argument will be set automatically by the compiler.</param>\r
-        /// <param name="line">The line number of calling position. This argument will be set automatically by the compiler.</param>\r
-        public static void Error(string tag, string msg, [CallerFilePath] string file = "", [CallerMemberName] string func = "", [CallerLineNumber] int line = 0)\r
-        {\r
-            if (String.IsNullOrEmpty(file))\r
-            {\r
-                NativeMethods.DlogPrint(NativeMethods.LogPriority.DLOG_ERROR, tag, "%s", msg);\r
-            }\r
-            else\r
-            {\r
-                Uri f = new Uri(file);\r
-                NativeMethods.DlogPrint(NativeMethods.LogPriority.DLOG_ERROR, tag, "%s: %s(%d) > %s", Path.GetFileName(f.AbsolutePath), func, line, msg);\r
-            }\r
-        }\r
-\r
-        /// <summary>\r
-        /// Prints a log message with the FATAL priority.\r
-        /// </summary>\r
-        /// <param name="tag">The tag name of the log message.</param>\r
-        /// <param name="msg">The log message to print.</param>\r
-        /// <param name="file">The source file path of the caller function. This argument will be set automatically by the compiler.</param>\r
-        /// <param name="func">The function name of caller function. This argument will be set automatically by the compiler.</param>\r
-        /// <param name="line">The line number of calling position. This argument will be set automatically by the compiler.</param>\r
-        public static void Fatal(string tag, string msg, [CallerFilePath] string file = "", [CallerMemberName] string func = "", [CallerLineNumber] int line = 0)\r
-        {\r
-            if (String.IsNullOrEmpty(file))\r
-            {\r
-                NativeMethods.DlogPrint(NativeMethods.LogPriority.DLOG_FATAL, tag, "%s", msg);\r
-            }\r
-            else\r
-            {\r
-                Uri f = new Uri(file);\r
-                NativeMethods.DlogPrint(NativeMethods.LogPriority.DLOG_FATAL, tag, "%s: %s(%d) > %s", Path.GetFileName(f.AbsolutePath), func, line, msg);\r
-            }\r
-        }\r
-    }\r
-}\r
+/// Copyright 2016 by Samsung Electronics, Inc.,
+///
+/// This software is the confidential and proprietary information
+/// of Samsung Electronics, Inc. ("Confidential Information"). You
+/// shall not disclose such Confidential Information and shall use
+/// it only in accordance with the terms of the license agreement
+/// you entered into with Samsung.
+
+
+using System;
+using System.IO;
+using System.Runtime.CompilerServices;
+
+namespace Tizen
+{
+    /// <summary>
+    /// Provides methods to print log messages to Tizen logging system.
+    /// </summary>
+    public class Log
+    {
+        /// <summary>
+        /// Prints a log message with the DEBUG priority.
+        /// </summary>
+        /// <param name="tag">The tag name of the log message.</param>
+        /// <param name="msg">The log message to print.</param>
+        /// <param name="file">The source file path of the caller function. This argument will be set automatically by the compiler.</param>
+        /// <param name="func">The function name of caller function. This argument will be set automatically by the compiler.</param>
+        /// <param name="line">The line number of calling position. This argument will be set automatically by the compiler.</param>
+        public static void Debug(string tag, string msg, [CallerFilePath] string file = "", [CallerMemberName] string func = "", [CallerLineNumber] int line = 0)
+        {
+            if (String.IsNullOrEmpty(file))
+            {
+                Interop.Dlog.Print(Interop.Dlog.LogPriority.DLOG_DEBUG, tag, "%s", msg);
+            }
+            else
+            {
+                Uri f = new Uri(file);
+                Interop.Dlog.Print(Interop.Dlog.LogPriority.DLOG_DEBUG, tag, "%s: %s(%d) > %s", Path.GetFileName(f.AbsolutePath), func, line, msg);
+            }
+        }
+
+        /// <summary>
+        /// Prints a log message with the VERBOSE priority.
+        /// </summary>
+        /// <param name="tag">The tag name of the log message.</param>
+        /// <param name="msg">The log message to print.</param>
+        /// <param name="file">The source file path of the caller function. This argument will be set automatically by the compiler.</param>
+        /// <param name="func">The function name of caller function. This argument will be set automatically by the compiler.</param>
+        /// <param name="line">The line number of calling position. This argument will be set automatically by the compiler.</param>
+        public static void Verbose(string tag, string msg, [CallerFilePath] string file = "", [CallerMemberName] string func = "", [CallerLineNumber] int line = 0)
+        {
+            if (String.IsNullOrEmpty(file))
+            {
+                Interop.Dlog.Print(Interop.Dlog.LogPriority.DLOG_VERBOSE, tag, "%s", msg);
+            }
+            else
+            {
+                Uri f = new Uri(file);
+                Interop.Dlog.Print(Interop.Dlog.LogPriority.DLOG_VERBOSE, tag, "%s: %s(%d) > %s", Path.GetFileName(f.AbsolutePath), func, line, msg);
+            }
+        }
+
+        /// <summary>
+        /// Prints a log message with the INFO priority.
+        /// </summary>
+        /// <param name="tag">The tag name of the log message.</param>
+        /// <param name="msg">The log message to print.</param>
+        /// <param name="file">The source file path of the caller function. This argument will be set automatically by the compiler.</param>
+        /// <param name="func">The function name of caller function. This argument will be set automatically by the compiler.</param>
+        /// <param name="line">The line number of calling position. This argument will be set automatically by the compiler.</param>
+        public static void Info(string tag, string msg, [CallerFilePath] string file = "", [CallerMemberName] string func = "", [CallerLineNumber] int line = 0)
+        {
+            if (String.IsNullOrEmpty(file))
+            {
+                Interop.Dlog.Print(Interop.Dlog.LogPriority.DLOG_INFO, tag, "%s", msg);
+            }
+            else
+            {
+                Uri f = new Uri(file);
+                Interop.Dlog.Print(Interop.Dlog.LogPriority.DLOG_INFO, tag, "%s: %s(%d) > %s", Path.GetFileName(f.AbsolutePath), func, line, msg);
+            }
+        }
+
+        /// <summary>
+        /// Prints a log message with the WARNING priority.
+        /// </summary>
+        /// <param name="tag">The tag name of the log message.</param>
+        /// <param name="msg">The log message to print.</param>
+        /// <param name="file">The source file path of the caller function. This argument will be set automatically by the compiler.</param>
+        /// <param name="func">The function name of caller function. This argument will be set automatically by the compiler.</param>
+        /// <param name="line">The line number of calling position. This argument will be set automatically by the compiler.</param>
+        public static void Warn(string tag, string msg, [CallerFilePath] string file = "", [CallerMemberName] string func = "", [CallerLineNumber] int line = 0)
+        {
+            if (String.IsNullOrEmpty(file))
+            {
+                Interop.Dlog.Print(Interop.Dlog.LogPriority.DLOG_WARN, tag, "%s", msg);
+            }
+            else
+            {
+                Uri f = new Uri(file);
+                Interop.Dlog.Print(Interop.Dlog.LogPriority.DLOG_WARN, tag, "%s: %s(%d) > %s", Path.GetFileName(f.AbsolutePath), func, line, msg);
+            }
+        }
+
+        /// <summary>
+        /// Prints a log message with the ERROR priority.
+        /// </summary>
+        /// <param name="tag">The tag name of the log message.</param>
+        /// <param name="msg">The log message to print.</param>
+        /// <param name="file">The source file path of the caller function. This argument will be set automatically by the compiler.</param>
+        /// <param name="func">The function name of caller function. This argument will be set automatically by the compiler.</param>
+        /// <param name="line">The line number of calling position. This argument will be set automatically by the compiler.</param>
+        public static void Error(string tag, string msg, [CallerFilePath] string file = "", [CallerMemberName] string func = "", [CallerLineNumber] int line = 0)
+        {
+            if (String.IsNullOrEmpty(file))
+            {
+                Interop.Dlog.Print(Interop.Dlog.LogPriority.DLOG_ERROR, tag, "%s", msg);
+            }
+            else
+            {
+                Uri f = new Uri(file);
+                Interop.Dlog.Print(Interop.Dlog.LogPriority.DLOG_ERROR, tag, "%s: %s(%d) > %s", Path.GetFileName(f.AbsolutePath), func, line, msg);
+            }
+        }
+
+        /// <summary>
+        /// Prints a log message with the FATAL priority.
+        /// </summary>
+        /// <param name="tag">The tag name of the log message.</param>
+        /// <param name="msg">The log message to print.</param>
+        /// <param name="file">The source file path of the caller function. This argument will be set automatically by the compiler.</param>
+        /// <param name="func">The function name of caller function. This argument will be set automatically by the compiler.</param>
+        /// <param name="line">The line number of calling position. This argument will be set automatically by the compiler.</param>
+        public static void Fatal(string tag, string msg, [CallerFilePath] string file = "", [CallerMemberName] string func = "", [CallerLineNumber] int line = 0)
+        {
+            if (String.IsNullOrEmpty(file))
+            {
+                Interop.Dlog.Print(Interop.Dlog.LogPriority.DLOG_FATAL, tag, "%s", msg);
+            }
+            else
+            {
+                Uri f = new Uri(file);
+                Interop.Dlog.Print(Interop.Dlog.LogPriority.DLOG_FATAL, tag, "%s: %s(%d) > %s", Path.GetFileName(f.AbsolutePath), func, line, msg);
+            }
+        }
+    }
+}
similarity index 77%
rename from src/Tizen/LogTraceListener.cs
rename to src/Tizen/Tizen/LogTraceListener.cs
index 43fe0c7..5b288cc 100755 (executable)
-using System;\r
-using System.Text;\r
-using System.Diagnostics;\r
-\r
-namespace Tizen\r
-{\r
-    /// <summary>\r
-    /// Directs tracing or debugging output to Tizen logging system.\r
-    /// </summary>\r
-    public class LogTraceListener : TraceListener\r
-    {\r
-        private string tagName = null;\r
-        private StringBuilder buf = new StringBuilder();\r
-\r
-        /// <summary>\r
-        /// Initializes a new instance of the LogTraceListener class, using the specfied tag name of the logging system.\r
-        /// </summary>\r
-        /// <param name="tag">The tag name of the log message.</param>\r
-        public LogTraceListener(string tag) : base("DLOG")\r
-        {\r
-            this.tagName = tag;\r
-        }\r
-\r
-        /// <summary>\r
-        /// The tag name of the log message.\r
-        /// </summary>\r
-        public string Tag\r
-        {\r
-            get { return tagName; }\r
-            set { tagName = value; }\r
-        }\r
-\r
-        private void WriteImpl(string message)\r
-        {\r
-            if (NeedIndent)\r
-            {\r
-                WriteIndent();\r
-            }\r
-            buf.Append(message);\r
-        }\r
-\r
-        /// <summary>\r
-        /// Writes an error message to the logging system.\r
-        /// </summary>\r
-        /// <param name="message">The error message to print.</param>\r
-        public override void Fail(string message)\r
-        {\r
-            Fail(message, null);\r
-        }\r
-\r
-        /// <summary>\r
-        /// Writes an error message and a detailed error message to the logging system.\r
-        /// </summary>\r
-        /// <param name="message">The error message to print.</param>\r
-        /// <param name="detailMessage">The detailed error message to print.</param>\r
-        public override void Fail(string message, string detailMessage)\r
-        {\r
-            StringBuilder failBuf = new StringBuilder();\r
-            failBuf.Append("Fail: ");\r
-            failBuf.Append(message);\r
-            if (!String.IsNullOrEmpty(detailMessage))\r
-            {\r
-                failBuf.Append(" ");\r
-                failBuf.Append(detailMessage);\r
-            }\r
-            Log.Error(tagName, failBuf.ToString(), null);\r
-        }\r
-\r
-        /// <summary>\r
-        /// Writes a log message to the logging system.\r
-        /// </summary>\r
-        /// <param name="message">The log message to print.</param>\r
-        public override void Write(string message)\r
-        {\r
-            WriteImpl(message);\r
-        }\r
-\r
-        /// <summary>\r
-        /// Writes a log message followed by the current line terminator to the logging system.\r
-        /// </summary>\r
-        /// <param name="message">The log message to print.</param>\r
-        public override void WriteLine(string message)\r
-        {\r
-            WriteImpl(message + Environment.NewLine);\r
-            NeedIndent = true;\r
-            Flush();\r
-        }\r
-\r
-        /// <summary>\r
-        /// Causes buffered data to be written to the logging system.\r
-        /// </summary>\r
-        public override void Flush()\r
-        {\r
-            Log.Debug(tagName, buf.ToString(), null);\r
-            buf.Clear();\r
-        }\r
-    }\r
-}\r
+/// Copyright 2016 by Samsung Electronics, Inc.,
+///
+/// This software is the confidential and proprietary information
+/// of Samsung Electronics, Inc. ("Confidential Information"). You
+/// shall not disclose such Confidential Information and shall use
+/// it only in accordance with the terms of the license agreement
+/// you entered into with Samsung.
+
+
+using System;
+using System.Text;
+using System.Diagnostics;
+
+namespace Tizen
+{
+    /// <summary>
+    /// Directs tracing or debugging output to Tizen logging system.
+    /// </summary>
+    public class LogTraceListener : TraceListener
+    {
+        private string _tagName = null;
+        private readonly StringBuilder _buf = new StringBuilder();
+
+        /// <summary>
+        /// Initializes a new instance of the LogTraceListener class, using the specfied tag name of the logging system.
+        /// </summary>
+        /// <param name="tag">The tag name of the log message.</param>
+        public LogTraceListener(string tag) : base("DLOG")
+        {
+            _tagName = tag;
+        }
+
+        /// <summary>
+        /// The tag name of the log message.
+        /// </summary>
+        public string Tag
+        {
+            get { return _tagName; }
+            set { _tagName = value; }
+        }
+
+        private void WriteImpl(string message)
+        {
+            if (NeedIndent)
+            {
+                WriteIndent();
+            }
+            _buf.Append(message);
+        }
+
+        /// <summary>
+        /// Writes an error message to the logging system.
+        /// </summary>
+        /// <param name="message">The error message to print.</param>
+        public override void Fail(string message)
+        {
+            Fail(message, null);
+        }
+
+        /// <summary>
+        /// Writes an error message and a detailed error message to the logging system.
+        /// </summary>
+        /// <param name="message">The error message to print.</param>
+        /// <param name="detailMessage">The detailed error message to print.</param>
+        public override void Fail(string message, string detailMessage)
+        {
+            StringBuilder failBuf = new StringBuilder();
+            failBuf.Append("Fail: ");
+            failBuf.Append(message);
+            if (!String.IsNullOrEmpty(detailMessage))
+            {
+                failBuf.Append(" ");
+                failBuf.Append(detailMessage);
+            }
+            Log.Error(_tagName, failBuf.ToString(), null);
+        }
+
+        /// <summary>
+        /// Writes a log message to the logging system.
+        /// </summary>
+        /// <param name="message">The log message to print.</param>
+        public override void Write(string message)
+        {
+            WriteImpl(message);
+        }
+
+        /// <summary>
+        /// Writes a log message followed by the current line terminator to the logging system.
+        /// </summary>
+        /// <param name="message">The log message to print.</param>
+        public override void WriteLine(string message)
+        {
+            WriteImpl(message + Environment.NewLine);
+            NeedIndent = true;
+            Flush();
+        }
+
+        /// <summary>
+        /// Causes buffered data to be written to the logging system.
+        /// </summary>
+        public override void Flush()
+        {
+            Log.Debug(_tagName, _buf.ToString(), null);
+            _buf.Clear();
+        }
+    }
+}