From df7b1dbbaeff7c6bc628c37f801bc04cbb5f4d28 Mon Sep 17 00:00:00 2001 From: xxred Date: Wed, 13 Feb 2019 20:28:36 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DErrorModule=E4=B8=AD=E9=97=B4?= =?UTF-8?q?=E4=BB=B6=E4=B8=ADlogger=E5=9B=A0=E4=B8=BAformatter=E4=B8=BA?= =?UTF-8?q?=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitattributes | 63 +++++++++++++++++++ .../Areas/Admin/Views/_ViewImports.cshtml | 4 +- NewLife.CubeNC/NewLife.CubeNC.csproj | 12 +--- NewLife.CubeNC/WebMiddleware/ErrorModule.cs | 2 +- 4 files changed, 66 insertions(+), 15 deletions(-) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000..1ff0c4230 --- /dev/null +++ b/.gitattributes @@ -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 diff --git a/NewLife.CubeNC/Areas/Admin/Views/_ViewImports.cshtml b/NewLife.CubeNC/Areas/Admin/Views/_ViewImports.cshtml index 6500a700c..9e05a444a 100644 --- a/NewLife.CubeNC/Areas/Admin/Views/_ViewImports.cshtml +++ b/NewLife.CubeNC/Areas/Admin/Views/_ViewImports.cshtml @@ -1,6 +1,4 @@ -@using NewLife.Cube -@*@using NewLife.Cube.Models*@ -@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers +@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers @using NewLife @using NewLife.Cube @using NewLife.Reflection diff --git a/NewLife.CubeNC/NewLife.CubeNC.csproj b/NewLife.CubeNC/NewLife.CubeNC.csproj index 26fb8a13c..06261fa98 100644 --- a/NewLife.CubeNC/NewLife.CubeNC.csproj +++ b/NewLife.CubeNC/NewLife.CubeNC.csproj @@ -102,6 +102,7 @@ + @@ -187,21 +188,10 @@ - - - ..\DLL20\NewLife.Core.dll - - - ..\DLL20\XCode.dll - - $(IncludeRazorContentInPack) - - TextTemplatingFileGenerator - diff --git a/NewLife.CubeNC/WebMiddleware/ErrorModule.cs b/NewLife.CubeNC/WebMiddleware/ErrorModule.cs index a6427aeb9..ef5db9878 100644 --- a/NewLife.CubeNC/WebMiddleware/ErrorModule.cs +++ b/NewLife.CubeNC/WebMiddleware/ErrorModule.cs @@ -38,7 +38,7 @@ public async Task Invoke(HttpContext context, IRazorViewEngine viewEngine, ILogg catch (Exception e) { XTrace.WriteException(e); - logger.Log(LogLevel.Error, 1, e, e, null); + logger.Log(LogLevel.Error, 1, e, e, (e1, e2) => e.ToString()); if (context.Response.HasStarted) {