Produced by Araxis Merge on 3/21/2018 5:29:19 PM Eastern Daylight Time. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a modern standards-compliant browser. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.
| # | Location | File | Last Modified |
|---|---|---|---|
| 1 | Wed Mar 21 21:29:19 2018 UTC | ||
| 2 | AHOBPRe_v4.3.15_bld3.zip\Utilities\AHOBPR_PDF_Utility\AHOBPR_PDF_Utility\Logger.zip | Logger.cs | Mon Apr 25 18:42:36 2016 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 0 | 0 |
| Changed | 0 | 0 |
| Inserted | 1 | 58 |
| Removed | 0 | 0 |
| Whitespace | |
|---|---|
| Character case | Differences in character case are significant |
| Line endings | Differences in line endings (CR and LF characters) are ignored |
| CR/LF characters | Not shown in the comparison detail |
No regular expressions were active.
| 1 | using Syst em; | |||||
| 2 | using Syst em.IO; | |||||
| 3 | using Syst em.Linq; | |||||
| 4 | using Syst em.Diagnos tics; | |||||
| 5 | ||||||
| 6 | ||||||
| 7 | namespace AHOBPR_PDF _Utility | |||||
| 8 | { | |||||
| 9 | public class Log ger | |||||
| 10 | { | |||||
| 11 | pr ivate stri ng _logFil eName = Di rectory.Ge tCurrentDi rectory() + "\\" + " AHOBPR_PDF _Utility" + "_" + Da teTime.Now .ToString( "yyyyMMdd" ) + ".log" ; | |||||
| 12 | ||||||
| 13 | pu blic void StartLog() | |||||
| 14 | { | |||||
| 15 | if (!Fil e.Exists(_ logFileNam e)) | |||||
| 16 | { | |||||
| 17 | File Stream fs = File.Cre ate(_logFi leName); | |||||
| 18 | fs.C lose(); | |||||
| 19 | } | |||||
| 20 | LogMessa geToFile(" ---------- ---------- ---------- ---------- ---------- ---------- ---------" ); | |||||
| 21 | } | |||||
| 22 | ||||||
| 23 | pu blic void LogErrorMe ssage(Exce ption ex) | |||||
| 24 | { | |||||
| 25 | using (S treamWrite r writer = File.Appe ndText("AH OBPR_PDF_U tility" + "_" + Date Time.Now.T oString("y yyyMMdd") + ".log")) | |||||
| 26 | { | |||||
| 27 | stri ng message = string. Empty; | |||||
| 28 | Stac kTrace sta ck = new S tackTrace( ex, true); | |||||
| 29 | ||||||
| 30 | writ er.WriteLi ne("{0}: { 1}", DateT ime.Now.To ShortDateS tring() + " " + Date Time.Now.T oLongTimeS tring(), " EXCEPTION: " + ex.Me ssage.Repl ace("\r\n" , "\r\n ")); | |||||
| 31 | fore ach (Stack Frame fram e in stack .GetFrames ()) | |||||
| 32 | { | |||||
| 33 | if (string .IsNullOrE mpty(frame .GetFileNa me())) | |||||
| 34 | { | |||||
| 35 | messag e = string .Format("M ETHOD: {0} ", frame.G etMethod() .ToString( )); | |||||
| 36 | } | |||||
| 37 | else | |||||
| 38 | { | |||||
| 39 | messag e = string .Format("F ILE: {0}, LINE: {1}, METHOD: { 2}", | |||||
| 40 | fr ame.GetFil eName(), f rame.GetFi leLineNumb er().ToStr ing(), fra me.GetMeth od().ToStr ing()); | |||||
| 41 | } | |||||
| 42 | ||||||
| 43 | writer.Wri teLine(" " + messa ge); | |||||
| 44 | } | |||||
| 45 | } | |||||
| 46 | } | |||||
| 47 | ||||||
| 48 | pu blic void LogMessage ToFile(str ing messag e) | |||||
| 49 | { | |||||
| 50 | using (S treamWrite r writer = File.Appe ndText("AH OBPR_PDF_U tility" + "_" + Date Time.Now.T oString("y yyyMMdd") + ".log")) | |||||
| 51 | { | |||||
| 52 | writ er.WriteLi ne("{0}: { 1}", DateT ime.Now.To ShortDateS tring() + " " + Date Time.Now.T oLongTimeS tring(), m essage); | |||||
| 53 | } | |||||
| 54 | } | |||||
| 55 | ||||||
| 56 | ||||||
| 57 | } | |||||
| 58 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.