This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void InitLog(string log4netConfigXmlPath, string logFilePath) | |
{ | |
XmlDocument doc = new XmlDocument(); | |
doc.Load(log4netConfigXmlPath); | |
// log4net 설정 XML 에서 "FileLog" 라는 이름의 appender 를 찾아서 설정으로 받은 | |
// 로그 파일 경로를 변경해준다. log4net 설정 XML을 만들 때 주의. | |
XmlAttribute filePathAttr = (XmlAttribute)doc.SelectSingleNode("/log4net/appender[@name='FileLog']/file/@value"); | |
filePathAttr.Value = logFilePath; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static FileInfo[] ShuffleArray (FileInfo[] src) | |
{ | |
FileInfo[] result = new FileInfo[src.Length]; | |
Random ran = new Random (); | |
List<KeyValuePair<int, FileInfo>> list = new List<KeyValuePair<int, FileInfo>> (src.Length); | |
foreach (var fi in src) | |
{ | |
list.Add (new KeyValuePair<int, FileInfo> (ran.Next (), fi)); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
try | |
{ | |
throw new Exception('an exception'); | |
} | |
catch (NotDefinedExceptionClass $eae) | |
{ | |
echo $eae->getMessage(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public abstract class VthreeModule : NancyModule | |
{ | |
static ILog LOGGER; | |
static VthreeModule() | |
{ | |
LOGGER = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | |
} |
NewerOlder