Class GeometryHelperLog
- Namespace
- GeometryHelper
- Assembly
- GeometryHelper.dll
Where the GeometryHelper libraries report what they left out or could not do.
Conversions that walk many objects skip what they cannot read rather than throw, because one bad object should not cost the rest. What was skipped, and why, is written here, so that an empty or short result can be explained: an IFC file that could not be opened, a reference model that is not IFC, a body the transformation could not rebuild.
Messages go to Trace under the category TraceCategory unless Writer is set. The Output window of Visual Studio shows them while debugging, and DebugView shows them from a plugin running inside Tekla or AutoCAD. Set Writer to send them to a file, a status bar or another logging library instead, and Enable to false to turn them off. Writer has examples for the console, the status bar of Tekla Structures and a file.
Writing a message never throws: a writer that fails is ignored, so logging cannot break the work it reports on. Like Global, the settings are shared by the whole process.
public static class GeometryHelperLog
- Inheritance
-
GeometryHelperLog
- Inherited Members
Fields
- TraceCategory
The Trace category messages are written under when no Writer is set.
Properties
- Enable
Gets or sets whether messages are written at all. Defaults to
true.
- Writer
Gets or sets what receives each message: its level, its text and the exception behind it, if any. Null, the default, writes Format(GeometryHelperLogLevel, string, Exception) of the message to Trace.
Methods
- Debug(string, Exception)
Writes detail that helps follow what happened, such as an object skipped for an expected reason.
- Err(string, Exception)
Writes that something failed that the caller should know about.
- Format(GeometryHelperLogLevel, string, Exception)
Formats a message the way the default writer does, for example
WARN The IFC file cannot be read. [IOException: The file is in use.].
- Info(string, Exception)
Writes the ordinary outcome of an operation.
- Warn(string, Exception)
Writes that something was left out or could not be done, and the work went on without it.