Excel-DNA / Excel-DNA/ExcelDna

Allow developers to remove the `LogDisplay` trace listener

Open
#274 2 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
C#
Stars
1.5k
Forks
292
Avg merge
20d 12h
Merged PRs (30d)
1

Description

Currently there's no way to _remove_ the `LogDisplayTraceListener` from the `ExcelDna.Integration` trace source. My expectation is that the code below would remove the (automatically added) `LogDisplay` listener, the same way that it removes the `Default` listener, but in practice it has no effect:

```xml










```

---

Start of a File-New Project add-in:

![image](https://user-images.githubusercontent.com/177608/68333555-1cc26480-00af-11ea-9275-639d4a3989f0.png)

---

#### Workaround

The current workaround is to add the `LogDisplay` listener to the configuration, and switch it off (`initializeData="Off"`), which is not the same as removing it:

```xml











```

Actually, I'd expect the code above to throw an exception, given that a listener with the name `LogDisplay` already exists (by default) so unless it's removed first, we should get an error.

This is my expectation of the correct code to override the default `LogDisplay` listener:

```xml












```

---

Related documentation
* [Diagnostic Logging](https://github.com/Excel-DNA/ExcelDna/wiki/Diagnostic-Logging#default-configuration)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.