/// <summary> /// This is a shortcut to log the exception message to the Ximura Logging provider. /// This may be overriden in derived classes to provide a more detailed breakdown. /// </summary> /// <param name="provider">The Ximura logging provider to log to.</param> /// <returns>A boolean value. True indicated that the message was successfully logged.</returns> public virtual bool LogException(IXimuraLogging provider) { if (provider == null) return false; try { provider.WriteLine(this.Message); } catch { return false; } return true; }
private static void WriteItem(IXimuraLogging logger, QueueItem item) { IXimuraLoggingExtended exLog = logger as IXimuraLoggingExtended; if (item.writeline) if (exLog!=null) { if (item.logAsString) exLog.WriteLine(item.message as string,item.category,item.type); else exLog.WriteLine(item.message.ToString(),item.category,item.type); } else { if (item.logAsString) logger.WriteLine(item.message,item.category); else logger.WriteLine(item.message.ToString(),item.category); } else { if (exLog!=null) { if (item.logAsString) exLog.Write(item.message as string,item.category,item.type); else exLog.Write(item.message.ToString(),item.category,item.type); } else { if (!item.logAsString) logger.Write(item.message,item.category); else logger.Write(item.message.ToString(),item.category); } } }