本文整理汇总了C#中Logger.log方法的典型用法代码示例。如果您正苦于以下问题:C# Logger.log方法的具体用法?C# Logger.log怎么用?C# Logger.log使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Logger
的用法示例。
在下文中一共展示了Logger.log方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Main
public static void Main(string[] args)
{
logger = new Logger(logFile);
dataFetcher = new GetInfo();
dataParser = new DataParser();
imdbDataFetcher = new GetIMDBInfo();
imdbDataParser = new IMDBDataParser();
outputWriter = new OutputWriter();
String[] movieDirectory = GetMovieNames();
logger.log("Fetched [" + movieDirectory.Length.ToString() + "] movies");
foreach (String moviePath in movieDirectory) {
logger.flush();
String movieName = moviePath.Replace(baseDirectory + "/", "");
logger.log("Processing [" + movieName + "]");
//Split out the directory name to get title and year
DataFromFile dataFromFile = new DataFromFile(movieName);
logger.log ("Split directory name to name [" + dataFromFile.getName() + "] and year [" + dataFromFile.getYear() + "]");
//Grab rotten tomatoes data
String rottenJson = dataFetcher.getData(movieName);
rottenJson = rottenJson.Trim();
MovieInfo rottenParsed = dataParser.getParsedData(rottenJson);
if (rottenParsed == null) {
failedMovies.Add(movieName);
logger.log("Failed to get rottentomatoes data for movie [" + movieName + "]");
continue;
}
processMovieInfo(rottenParsed.Movies[0], dataFromFile, moviePath, failedMovies);
}
logger.closeLog();
}
示例2: XmppManager
/// <summary>
///
/// </summary>
/// <param name="sJid">S jid.</param>
/// <param name="sPassword">S password.</param>
public XmppManager(AuthInfo authInfo, XmppServiceDescription xmppServiceDescription, OTRKeyRing _OTRKeyRing, OpenPGPRing _OpenPGPRing, ConversationManager _conversationManager, AddressBook _addressBook, Logger _logger)
{
try
{
m_Logger = _logger;
m_OTRKeyRing = _OTRKeyRing;
m_OpenPGPRing = _OpenPGPRing;
m_AuthInfo = authInfo;
m_OwnJid = new Jid (m_AuthInfo.m_sId);
m_ClientConnection = new XmppClientConnection(m_OwnJid.Server);
m_Contacts = new Dictionary<string, string> ();
m_Logger.log(ELogLevel.LVL_INFO, "Trying to log in xmpp user", m_sModuleName);
m_ClientConnection.Open(m_OwnJid.User, m_AuthInfo.m_sPassword);
m_ConversationManager = _conversationManager;
m_AddressBook = _addressBook;
m_PresenceManager = new PresenceManager(m_AddressBook);
m_OtrConnections = new Dictionary<string, int>();
//register EventHandlers
m_ClientConnection.OnLogin += new ObjectHandler(onLogin);
m_ClientConnection.OnPresence += new PresenceHandler(OnPresence);
}
catch(Exception e) {
Console.Write (e.Message);
}
//info: message callback is registered in onRosterItem callback
}
示例3: Main
/**********************************************************************
* *
* Main()
* *
**********************************************************************/
/**
<summary>
Entry point of the experiment engine.
</summary>
<remarks>
insert detailed description for Main here...
@cond INTERNAL
documented by t.wilhelmer, 8.11.2015
@endcond
</remarks>
<param name="args">In/Out: description </param>
<returns> return value description here </returns>
*/
public static void Main(string[] args)
{
ExperimentEngine engine = new ExperimentEngine();
bool noException = true;
RestAPI restAPI = new RestAPI(Authorize.xapikey, Authorize.userID);
Logger logger = new Logger();
Status status = Status.CHECKFOREXPERIMENT;
while (noException == true)
{
switch (status)
{
case Status.CHECKFOREXPERIMENT:
logger.log("Checking for a new experiment");
while (status == Status.CHECKFOREXPERIMENT)
{
Console.WriteLine("Waiting for experiment.");
Thread.Sleep(3000);
status = engine.checkForNewExperiment(restAPI);
}
break;
case Status.DEQUEUEEXPERIMENT:
Console.WriteLine("Dequeue experiment.");
status = engine.dequeueExperiment(restAPI);
break;
case Status.PERFORMEXPERIMENT:
Console.WriteLine("Perform experiment.");
status = engine.performExperiment();
//Entering point for experiment calculations etc.
break;
case Status.RETURNDATA:
Console.WriteLine("Return experiment data.");
status = engine.returnData(restAPI);
break;
//case Status.RELEASEENGINE:
// status = releaseEngine(client);
// break;
case Status.ERROR:
Console.WriteLine("A \"success\" parameter was returned as \"false\"");
logger.log("An error occurred: errorReport:" + engine.errorReport);
logger.log("Restarting state machine. \n");
logger.errorLog("An internal error occurred. Please see EvaluationLog.txt for more details.");
status = engine.abortExperiment(restAPI, engine.errorReport);
break;
case Status.EXCEPTION:
noException = false;
Console.WriteLine("An exception occurred. Please check the ErrorLog.txt for more details.");
break;
default:
status = Status.EXCEPTION;
logger.errorLog("A undefined state of the state machine has been called.");
break;
}
}
}
示例4: Test_01_Setup
/// <summary>
/// Tests 01 setup.
/// </summary>
private static void Test_01_Setup()
{
AssetManager.Instance.Bridge = bridge2;
//! Add assets and automatically create the Asset Manager.
//
asset1 = new Asset();
asset2 = new Asset();
asset3 = new Logger();
asset4 = new Logger();
asset5 = new DialogueAsset();
bridge2.Prefix = "private bridge: ";
// For Unity3D we need a bridge as Console.WriteLine is not supported and we have to use Debug.log() instead!
asset3.Bridge = bridge2;
asset3.log("Asset1: " + asset1.Class + ", " + asset1.Id);
asset3.log("Asset2: " + asset2.Class + ", " + asset2.Id);
asset3.log("Asset3: " + asset3.Class + ", " + asset3.Id);
asset3.log("Asset4: " + asset4.Class + ", " + asset4.Id);
asset3.log("Asset5: " + asset5.Class + ", " + asset5.Id);
}