<commit_before>![Icon](https://raw.github.com/Fody/Anotar/master/Icons/package_icon.png)

## This is an add-in for  [Fody](https://github.com/Fody/Fody) 

Simplifies logging through a static class and some IL manipulation

[Introduction to Fody](https://github.com/Fody/Fody/wiki/SampleUsage)

## Supported Logging Libraries

* [Catel](http://www.catelproject.com/)
* Custom (for frameworks/toolkits with custom logging)
* [CommonLogging](http://netcommon.sourceforge.net/)
* [LibLog](https://github.com/damianh/LibLog) 
* [Log4Net](http://logging.apache.org/log4net/) 
* [MetroLog](https://github.com/mbrit/MetroLog)
* [NLog](http://nlog-project.org/) 
* [Serilog](http://serilog.net/)
* [Splat](https://github.com/paulcbetts/splat)

## Nuget
  
 * Catel package http://nuget.org/packages/Anotar.Catel.Fody 

    PM> Install-Package Anotar.Catel.Fody
 
 * CommonLogging package http://nuget.org/packages/Anotar.CommonLogging.Fody 

    PM> Install-Package Anotar.CommonLogging.Fody
 
 * Custom package http://nuget.org/packages/Anotar.Custom.Fody 

    PM> Install-Package Anotar.Custom.Fody

 * LibLog package http://nuget.org/packages/Anotar.LibLog.Fody 

    PM> Install-Package Anotar.LibLog.Fody

 * Log4Net package http://nuget.org/packages/Anotar.Log4Net.Fody 

    PM> Install-Package Anotar.Log4Net.Fody
 
 * MetroLog package http://nuget.org/packages/Anotar.MetroLog.Fody 

    PM> Install-Package Anotar.MetroLog.Fody

 * NLog package http://nuget.org/packages/Anotar.NLog.Fody 

    PM> Install-Package Anotar.NLog.Fody
 
 * Serilog package http://nuget.org/packages/Anotar.Serilog.Fody 

    PM> Install-Package Anotar.Serilog.Fody
 
 * Splat package http://nuget.org/packages/Anotar.Splat.Fody 

    PM> Install-Package Anotar.Splat.Fody
 
## Explicit Logging


### Your Code

```
public class MyClass
{
    void MyMethod()
    {
        LogTo.Debug("TheMessage");
    }
}
```

### What gets compiled

#### In Catel

```
public class MyClass
{
    static ILog logger = LogManager.GetLogger(typeof(MyClass));

    void MyMethod()
    {
        logger.WriteWithData("Method: 'Void MyMethod()'. Line: ~12. TheMessage", null, LogEvent.Debug);
    }
}
```

#### In CommonLogging

```
public class MyClass
{
    static ILog logger = LoggerManager.GetLogger("MyClass");

    void MyMethod()
    {
        logger.Debug("Method: 'Void MyMethod()'. Line: ~12. TheMessage");
    }
}
```

#### In Custom

```
public class MyClass
{
    static Logger logger = LoggerFactory.GetLogger<MyClass>();

    void MyMethod()
    {
        logger.Debug("Method: 'Void MyMethod()'. Line: ~12. TheMessage");
    }
}
```

#### In LibLog

```
public class MyClass
{
    static ILog logger = LogProvider.GetCurrentClassLogger();

    void MyMethod()
    {
        logger.Debug("Method: 'Void MyMethod()'. Line: ~12. TheMessage");
    }
}
```

#### In Log4Net

```
public class MyClass
{
    static ILog logger = LogManager.GetLogger("MyClass");

    void MyMethod()
    {
        logger.Debug("Method: 'Void MyMethod()'. Line: ~12. TheMessage");
    }
}
```

#### In MetroLog

```
public class MyClass
{
    static ILogger logger = LogManagerFactory.DefaultLogManager.GetLogger("MyClass");

    void MyMethod()
    {<commit_msg>fix incorrect doco<commit_after>![Icon](https://raw.github.com/Fody/Anotar/master/Icons/package_icon.png)

## This is an add-in for  [Fody](https://github.com/Fody/Fody) 

Simplifies logging through a static class and some IL manipulation

[Introduction to Fody](https://github.com/Fody/Fody/wiki/SampleUsage)

## Supported Logging Libraries

* [Catel](http://www.catelproject.com/)
* Custom (for frameworks/toolkits with custom logging)
* [CommonLogging](http://netcommon.sourceforge.net/)
* [LibLog](https://github.com/damianh/LibLog) 
* [Log4Net](http://logging.apache.org/log4net/) 
* [MetroLog](https://github.com/mbrit/MetroLog)
* [NLog](http://nlog-project.org/) 
* [Serilog](http://serilog.net/)
* [Splat](https://github.com/paulcbetts/splat)

## Nuget
  
 * Catel package http://nuget.org/packages/Anotar.Catel.Fody 

    PM> Install-Package Anotar.Catel.Fody
 
 * CommonLogging package http://nuget.org/packages/Anotar.CommonLogging.Fody 

    PM> Install-Package Anotar.CommonLogging.Fody
 
 * Custom package http://nuget.org/packages/Anotar.Custom.Fody 

    PM> Install-Package Anotar.Custom.Fody

 * LibLog package http://nuget.org/packages/Anotar.LibLog.Fody 

    PM> Install-Package Anotar.LibLog.Fody

 * Log4Net package http://nuget.org/packages/Anotar.Log4Net.Fody 

    PM> Install-Package Anotar.Log4Net.Fody
 
 * MetroLog package http://nuget.org/packages/Anotar.MetroLog.Fody 

    PM> Install-Package Anotar.MetroLog.Fody

 * NLog package http://nuget.org/packages/Anotar.NLog.Fody 

    PM> Install-Package Anotar.NLog.Fody
 
 * Serilog package http://nuget.org/packages/Anotar.Serilog.Fody 

    PM> Install-Package Anotar.Serilog.Fody
 
 * Splat package http://nuget.org/packages/Anotar.Splat.Fody 

    PM> Install-Package Anotar.Splat.Fody
 
## Explicit Logging


### Your Code

```
public class MyClass
{
    void MyMethod()
    {
        LogTo.Debug("TheMessage");
    }
}
```

### What gets compiled

#### In Catel

```
public class MyClass
{
    static ILog logger = LogManager.GetLogger(typeof(MyClass));

    void MyMethod()
    {
        logger.WriteWithData("Method: 'Void MyMethod()'. Line: ~12. TheMessage", null, LogEvent.Debug);
    }
}
```

#### In CommonLogging

```
public class MyClass
{
    static ILog logger = LoggerManager.GetLogger("MyClass");

    void MyMethod()
    {
        logger.Debug("Method: 'Void MyMethod()'. Line: ~12. TheMessage");
    }
}
```

#### In Custom

```
public class MyClass
{
    static Logger logger = LoggerFactory.GetLogger<MyClass>();

    void MyMethod()
    {
        logger.Debug("Method: 'Void MyMethod()'. Line: ~12. TheMessage");
    }
}
```

#### In LibLog

```
public class MyClass
{
    static ILog logger = LogProvider.GetLogger("MyClass");

    void MyMethod()
    {
        logger.Debug("Method: 'Void MyMethod()'. Line: ~12. TheMessage");
    }
}
```

#### In Log4Net

```
public class MyClass
{
    static ILog logger = LogManager.GetLogger("MyClass");

    void MyMethod()
    {
        logger.Debug("Method: 'Void MyMethod()'. Line: ~12. TheMessage");
    }
}
```

#### In MetroLog

```
public class MyClass
{
    static ILogger logger = LogManagerFactory.DefaultLogManager.GetLogger("MyClass");

    void MyMethod()
    {
{'fraction_non_alphanumeric': 0.15355921666148586, 'fraction_numerical': 0.004973577867578489, 'mean_word_length': 3.453287197231834, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 23, 'https://': 12, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3121318', 'n_tokens_mistral': 2331, 'n_tokens_neox': 2212, 'n_words': 408}