/// <summary> /// Will return instance, or instantiate if instance is null. Will trigger /// the first log entry if file name has been set since program launch and /// instantiation was needed. /// </summary> /// <returns></returns> public static VBLogger GetLogger() { if (me == null) { lock (syncRoot) { me = new VBLogger(); if (!logFileName.Equals(String.Empty)) { me.LogFirstTime(); } } } return(me); }
/// <summary> /// Sets the static log file path. Triggers first log entry if instance is made. /// </summary> /// <param name="filePath">Full path to text file. File doesn't need to exist.</param> public static void SetLogFileName(String filePath) { if (filePath.Equals(String.Empty)) { if (me != null) { CloseLog(); } } else { logFileName = filePath; if (me != null) { me.LogFirstTime(); } } }
/// <summary> /// Will return instance, or instantiate if instance is null. Will trigger /// the first log entry if file name has been set since program launch and /// instantiation was needed. /// </summary> /// <returns></returns> public static VBLogger GetLogger() { if (me == null) { lock (syncRoot) { me = new VBLogger(); if (!logFileName.Equals(String.Empty)) { me.LogFirstTime(); } } } return me; }