TriEngine  v0.0.16
General-purpose engine in C#/OpenGL
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Events
TriDevs.TriEngine.Helpers.Exceptions Class Reference

Provides helper methods for dealing with exceptions. More...

Static Public Member Functions

static void LogException (Exception exception)
 Outputs exception details to default logger. More...
 

Detailed Description

Provides helper methods for dealing with exceptions.

Member Function Documentation

static void TriDevs.TriEngine.Helpers.Exceptions.LogException ( Exception  exception)
static

Outputs exception details to default logger.

Parameters
exceptionThe exception to log.
56  {
57  var type = "Generic";
58  if (exception is EngineException)
59  type = "Engine";
60 
61  _log.ErrorFormat("{0} exception {1} occurred with message: {2}", type, exception.GetType(), exception.Message);
62  if (exception.InnerException != null)
63  _log.ErrorFormat("Inner exception {0} with message: {1}", exception.InnerException.GetType(),
64  exception.InnerException.Message);
65  _log.Error("Exception details:", exception);
66  if (exception.InnerException != null)
67  _log.Error("Exception details for inner:", exception.InnerException);
68  }

The documentation for this class was generated from the following file: