Exemplo n.º 1
0
 /* Print data object in detail */
 public static void Info(object obj, Type _type, MethodBase _method, bool jsonObject = false)
 {
     if (airlineLog.IsInfoEnabled)
     {
         if (obj != null)
         {
             if (jsonObject)
             {
                 airlineLog.Info(string.Format("{0}:{1}:{2}[{2}{3}{2}]", _type.Name, _method.Name, Environment.NewLine, DataObjectHandler.SerializeObjToJsonString(obj)));
             }
             else
             {
                 airlineLog.Info(string.Format("{0}:{1}:{2}[{2}{3}{2}]", _type.Name, _method.Name, Environment.NewLine, DataObjectHandler.SerializeObjToXmlString(obj)));
             }
         }
         else
         {
             airlineLog.Info(string.Format("{0}.{1}:[]", _type.Name, _method.Name));
         }
     }
 }
Exemplo n.º 2
0
 /* Print data object in detail */
 public static void Error(object obj, Type _type, MethodBase _method, Exception ex)
 {
     if (airlineLog.IsErrorEnabled)
     {
         if (obj != null)
         {
             airlineLog.Error(string.Format("{0}:{1}:{2}[{2}{3}{2}]", _type.Name, _method.Name, Environment.NewLine, DataObjectHandler.SerializeObjToXmlString(obj)), ex);
         }
         else
         {
             airlineLog.Error(string.Format("{0}:{1}:[]", _type.Name, _method.Name), ex);
         }
     }
 }