# Logger class

Namespace: [Grasshopper2.Diagnostics](https://developer.rhino3d.com/api/gh2/namespace/grasshopper2.diagnostics.md) · Assembly: [Grasshopper2](https://developer.rhino3d.com/api/gh2/assembly/grasshopper2.md)

```cs
public static class Logger
```

General utility class for various runtime diagnostics.

## Fields

- [HideSensitiveInformationFromLog](https://developer.rhino3d.com/api/gh2/type/grasshopper2.diagnostics.logger/hidesensitiveinformationfromlog.md): (static) Gets or sets whether personal information (such as UserName or MachineName ought to be included in the log. This flag must be set SUUUPER early on because the first thing the Logger does it dump a bunch of system info into the current log stream. At present, this value is not assigned at all, given that https://www.mcneel.com/privacy allows us to write all this data. The problem arises only when the user decides to share the log files, at which point it will be much harder to remove any specific entry.

## Properties

- [Count](https://developer.rhino3d.com/api/gh2/type/grasshopper2.diagnostics.logger/count.md): (static) Gets the number of recorded messages in the current log.
- [Density](https://developer.rhino3d.com/api/gh2/type/grasshopper2.diagnostics.logger/density.md): (static) Gets or sets the logging density.

## Methods

- [Add](https://developer.rhino3d.com/api/gh2/type/grasshopper2.diagnostics.logger/add.md): (3 overloads, static) Log an exception message.
- [Clear](https://developer.rhino3d.com/api/gh2/type/grasshopper2.diagnostics.logger/clear.md): (static) Attempt to clear the current log file.
- [DeleteOldLogFiles](https://developer.rhino3d.com/api/gh2/type/grasshopper2.diagnostics.logger/deleteoldlogfiles.md): (2 overloads, static) Delete all log files older than one day.
- [Diagnostics](https://developer.rhino3d.com/api/gh2/type/grasshopper2.diagnostics.logger/diagnostics.md): (3 overloads, static) Read all entries from the current log file.
- [DumpDiagnosticsToFile](https://developer.rhino3d.com/api/gh2/type/grasshopper2.diagnostics.logger/dumpdiagnosticstofile.md): (static) Write a set of diagnostic messages to an HTML file. This method will not throw.
- [LogCurrentState](https://developer.rhino3d.com/api/gh2/type/grasshopper2.diagnostics.logger/logcurrentstate.md): (static) Write a bunch of information to the log describing the current state of the computer.
- [MeasureSpan](https://developer.rhino3d.com/api/gh2/type/grasshopper2.diagnostics.logger/measurespan.md): (2 overloads, static) Begin a new timespan measure. You *must* dispose this metric in order to include the measures interval in the log.
- [ShowDiagnosticsInBrowser](https://developer.rhino3d.com/api/gh2/type/grasshopper2.diagnostics.logger/showdiagnosticsinbrowser.md): (static) Show the provided logged entries in a window, and save them as an HTML file on the desktop, or in the temp folder if the desktop cannot be written to.
