Details
-
Wish
-
Status: Resolved
-
Minor
-
Resolution: Won't Fix
-
None
-
None
-
Visual Studio deployment with NuGet
Description
The deployment with NuGet for Visual Studio could installs also a snippet which could be used to declare a private static reference to logger "log4net.ILog". So, after installed the log4net via NuGet, we could just go to any class and type log<TAB> and a full and auto declaration appears referencing the enclosure type.
Following is a snippet I use today with C#, but needs to be installed apart on each Visual Studio installation. The main piece of the snippet is the declaration: private static readonly log4net.ILog log = log4net.LogManager.GetLogger(typeof($classname$));
SNIPPET DECLARATION:
<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<SnippetTypes>
<SnippetType>Expansion</SnippetType>
</SnippetTypes>
<Title>log4net - Declaration</Title>
<Author>Luciano</Author>
<Description>
</Description>
<HelpUrl>
</HelpUrl>
<Shortcut>log
</Shortcut>
</Header>
<Snippet>
<References>
<Reference>
<Assembly>log4net.dll</Assembly>
</Reference>
</References>
<Declarations>
<Literal Editable="true">
<ID>classname</ID>
<ToolTip>
</ToolTip>
<Function>
ClassName()
</Function>
</Literal>
</Declarations>
<Code Language="csharp">
<![CDATA[private static readonly log4net.ILog log = log4net.LogManager.GetLogger(typeof($classname$));]]>
</Code>
</Snippet>
</CodeSnippet>
</CodeSnippets>