本文整理汇总了C#中log4net.ILog.Debug方法的典型用法代码示例。如果您正苦于以下问题:C# ILog.Debug方法的具体用法?C# ILog.Debug怎么用?C# ILog.Debug使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类log4net.ILog
的用法示例。
在下文中一共展示了ILog.Debug方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Application_Startup
private void Application_Startup(object sender, StartupEventArgs e)
{
try
{
String log4net = String.Format(BogheApp.Properties.Resources.log4net_xml, Win32ServiceManager.SharedManager.ApplicationDataPath);
using (Stream stream = new MemoryStream(System.Text.Encoding.UTF8.GetBytes(log4net)))
{
XmlConfigurator.Configure(stream);
LOG = LogManager.GetLogger(typeof(App));
}
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
this.Shutdown();
}
LOG.Debug("====================================================");
LOG.Debug(String.Format("======Starting Boghe - IMS/RCS Client v{0} ====", System.Reflection.Assembly.GetEntryAssembly().GetName().Version));
LOG.Debug("====================================================");
if (!Win32ServiceManager.SharedManager.Start())
{
MessageBox.Show("Failed to start service manager");
this.Shutdown();
}
}
示例2: Application_Startup
private void Application_Startup(object sender, StartupEventArgs e)
{
try
{
String log4net = String.Format(BogheApp.Properties.Resources.log4net_xml, Win32ServiceManager.SharedManager.ApplicationDataPath);
using (Stream stream = new MemoryStream(System.Text.Encoding.UTF8.GetBytes(log4net)))
{
XmlConfigurator.Configure(stream);
LOG = LogManager.GetLogger(typeof(App));
}
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
this.Shutdown();
}
LOG.Debug("====================================================");
LOG.Debug(String.Format("======Starting Boghe - IMS/RCS Client v{0} ====", System.Reflection.Assembly.GetEntryAssembly().GetName().Version));
LOG.Debug("====================================================");
//CultureInfo culture = new CultureInfo("fr-FR");
// System.Threading.Thread.CurrentThread.CurrentCulture = culture;
// System.Threading.Thread.CurrentThread.CurrentUICulture = culture;
FrameworkElement.LanguageProperty.OverrideMetadata(
typeof(FrameworkElement),
new FrameworkPropertyMetadata(XmlLanguage.GetLanguage(CultureInfo.CurrentCulture.IetfLanguageTag)));
if (!Win32ServiceManager.SharedManager.Start())
{
MessageBox.Show("Failed to start service manager");
this.Shutdown();
}
}
示例3: HandleDatabase
/// <summary>
/// Default constructor
/// </summary>
public HandleDatabase() {
this.log = LogManager.GetLogger(this.GetType());
if (log.IsDebugEnabled) {
log.Debug("HandleDatabase Starts");
}
_conn = new SqlConnection(_connectionPath);
if (log.IsDebugEnabled) {
log.Debug("HandleDatabase Ends");
}
}
示例4: LogWith
public static IEnumerable<ISaga> LogWith(this IEnumerable<ISaga> sagas, ILog log)
{
var sagaCount = 0;
foreach (var saga in sagas)
{
sagaCount++;
log.Debug(string.Format("Loading Saga: {0}", saga.GetType().FullName));
yield return saga;
}
log.Debug(string.Format("Loaded {0} Sagas", sagaCount));
}
示例5: ToLog
public void ToLog(ILog log)
{
log.Debug("\tVersion: " + Version);
log.Debug("\tPollIntervalSeconds: " + PollIntervalSeconds);
log.Debug("\tCollectOnly: " + CollectOnly);
log.Debug("\tSqlEndpoints: " + Endpoints.Length);
foreach (var endpoint in Endpoints)
{
endpoint.Trace(log);
}
}
示例6: BeaglePlugin
public BeaglePlugin()
{
server = Daemon.Server;
db = Daemon.DefaultDatabase;
log = Daemon.Log;
query = new Query ();
query.AddDomain (QueryDomain.Neighborhood);
query.MaxHits = 10000;
QueryPart_Property filePart = new QueryPart_Property ();
filePart.Type = PropertyType.Keyword;
filePart.Key = "beagle:HitType";
filePart.Value = "File";
query.AddPart (filePart);
QueryPart_Or queryUnion = new QueryPart_Or ();
foreach (string mt in supportedMimeTypes) {
QueryPart_Property part = new QueryPart_Property ();
part.Type = PropertyType.Keyword;
part.Key = "beagle:MimeType";
part.Value = mt;
queryUnion.Add (part);
}
query.AddPart (queryUnion);
query.HitsAddedEvent += OnHitsAdded;
query.HitsSubtractedEvent += OnHitsSubtracted;
query.FinishedEvent += OnFinished;
int attempts = 0;
while (true) {
try {
query.SendAsync ();
break;
} catch (Exception e) {
if (attempts++ >= 5) {
log.Warn ("Failed to initialize beagle plugin");
query = null;
break;
}
// something bad happened, wait a sec and try again
log.Debug ("Sending query failed: " + e.Message);
log.Debug ("Waiting 3 seconds...");
Thread.Sleep (3000);
}
}
}
示例7: Trace
public override void Trace(ILog log)
{
base.Trace(log);
foreach (var database in IncludedDatabases)
{
log.Debug("\t\t\tIncluding: " + database.Name);
}
foreach (var database in ExcludedDatabaseNames)
{
log.Debug("\t\t\tExcluding: " + database);
}
}
示例8: Client
public Client(int id, Config cfg, SynchronizationContext ctx)
{
ClientStatisticsGatherer = new ClientStatisticsGatherer();
_ctx = ctx;
_id = id;
Data = new TestData(this);
IsStopped = false;
_log = LogManager.GetLogger("Client_" + _id);
_log.Debug("Client created");
Configure(cfg);
if (String.IsNullOrEmpty(_login))
{
const string err = "Login command is not specified!!! Can't do any test.";
_log.Error(err);
throw new Exception(err);
}
_ajaxHelper = new AjaxHelper(new AjaxConn(_login, cfg.ServerIp, cfg.AjaxPort, _ctx));
_webSock = new WebSockConn(_login, cfg.ServerIp, cfg.WsPort, ctx);
_webSock.CcsStateChanged += WsOnCcsStateChanged;
_webSock.InitializationFinished += () => _testMng.GetTest<LoginTest>().OnClientInitialized();
_testMng.SetEnv(_login, _ajaxHelper.AjaxConn, _webSock);
}
示例9: GetLogger
/// <summary>
/// Get a log4net instance based on the config
/// </summary>
/// <returns></returns>
public static ILog GetLogger()
{
//If _logger hasn't yet been initialised then create it
if (_logger == null)
{
//Configure log4net if not already configured
var configuredAlready = true;
var logRepository = LogManager.GetRepository();
if (!logRepository.Configured)
{
configuredAlready = false;
log4net.Config.XmlConfigurator.Configure();
}
//Come up with a name for our logger eg "Template.Web v1.0.4857.27024"
var assembly = Assembly.GetExecutingAssembly();
var folderNames = AppDomain.CurrentDomain.SetupInformation.ApplicationBase.Split('\\');
var loggerNamePrefix = (folderNames.Length > 2)
? folderNames[folderNames.Length - 2]
: AppDomain.CurrentDomain.SetupInformation.ApplicationBase; //If this lives is stored in the root of a drive (unlikely) then use the path for a name
var loggerName = string.Format("{0} v{1}",
loggerNamePrefix, //The path of the application executing
assembly.GetName().Version.ToString());
//Get our logger
_logger = LogManager.GetLogger(loggerName);
_logger.Debug(string.Format("Logger {0} with this name: {1}", configuredAlready ? "retrieved" : "configured and retrieved", loggerName));
}
//Return instance
return _logger;
}
示例10: LobbyBot
/// <summary>
/// Setup a new bot with some details.
/// </summary>
/// <param name="details"></param>
/// <param name="extensions">any extensions you want on the state machine.</param>
public LobbyBot(SteamUser.LogOnDetails details, params IExtension<States, Events>[] extensions)
{
reconnect = true;
this.details = details;
log = LogManager.GetLogger("LobbyBot " + details.Username);
log.Debug("Initializing a new LobbyBot, username: " + details.Username);
reconnectTimer.Elapsed += (sender, args) =>
{
reconnectTimer.Stop();
fsm.Fire(Events.AttemptReconnect);
};
fsm = new ActiveStateMachine<States, Events>();
foreach (var ext in extensions) fsm.AddExtension(ext);
fsm.DefineHierarchyOn(States.Connecting)
.WithHistoryType(HistoryType.None);
fsm.DefineHierarchyOn(States.Connected)
.WithHistoryType(HistoryType.None)
.WithInitialSubState(States.Dota);
fsm.DefineHierarchyOn(States.Dota)
.WithHistoryType(HistoryType.None)
.WithInitialSubState(States.DotaConnect)
.WithSubState(States.DotaMenu)
.WithSubState(States.DotaLobby);
fsm.DefineHierarchyOn(States.Disconnected)
.WithHistoryType(HistoryType.None)
.WithInitialSubState(States.DisconnectNoRetry)
.WithSubState(States.DisconnectRetry);
fsm.DefineHierarchyOn(States.DotaLobby)
.WithHistoryType(HistoryType.None);
fsm.In(States.Connecting)
.ExecuteOnEntry(InitAndConnect)
.On(Events.Connected).Goto(States.Connected)
.On(Events.Disconnected).Goto(States.DisconnectRetry)
.On(Events.LogonFailSteamDown).Execute(SteamIsDown)
.On(Events.LogonFailSteamGuard).Goto(States.DisconnectNoRetry) //.Execute(() => reconnect = false)
.On(Events.LogonFailBadCreds).Goto(States.DisconnectNoRetry);
fsm.In(States.Connected)
.ExecuteOnExit(DisconnectAndCleanup)
.On(Events.Disconnected).If(ShouldReconnect).Goto(States.Connecting)
.Otherwise().Goto(States.Disconnected);
fsm.In(States.Disconnected)
.ExecuteOnEntry(DisconnectAndCleanup)
.ExecuteOnExit(ClearReconnectTimer)
.On(Events.AttemptReconnect).Goto(States.Connecting);
fsm.In(States.DisconnectRetry)
.ExecuteOnEntry(StartReconnectTimer);
fsm.In(States.Dota)
.ExecuteOnExit(DisconnectDota);
fsm.In(States.DotaConnect)
.ExecuteOnEntry(ConnectDota)
.On(Events.DotaGCReady).Goto(States.DotaMenu);
fsm.In(States.DotaMenu)
.ExecuteOnEntry(SetOnlinePresence);
fsm.In(States.DotaLobby)
.ExecuteOnEntry(EnterLobbyChat)
.ExecuteOnEntry(EnterBroadcastChannel)
.On(Events.DotaLeftLobby).Goto(States.DotaMenu).Execute(LeaveChatChannel);
fsm.Initialize(States.Connecting);
}
示例11: InDatabaseRegionRepository
public InDatabaseRegionRepository(PDSDatabase context)
{
_context = context;
logger = LogManager.GetLogger(typeof(InDatabaseRegionRepository));
logger.Debug("Initialisiert");
}
示例12: MiniSSCIIServoController
/**
* <summary>
* Constructor with port name and open the port.
* Also initializes servo channels to center
* </summary>
*
* <param name="portName">Name of the serial port</param>
* <param name="channels">Channels to center on construction</param>
*/
protected MiniSSCIIServoController(string portName, ICollection<uint> channels)
{
log = LogManager.GetLogger(this.GetType());
log.Debug(this.ToString() + " constructed.");
activeChannels = channels;
try
{
port = new SerialPort(portName);
port.Open();
port.BaudRate = 9600;
port.NewLine = string.Empty + Convert.ToChar(13);
port.Handshake = System.IO.Ports.Handshake.None;
port.BaseStream.Flush();
port.ReadTimeout = 1000;
inactive = false;
foreach (uint ch in channels)
{
ServoMovementCommand smc = new ServoMovementCommand(ch, 128);
sendCommand(smc);
}
log.Info("Initiating all servos to center.");
}
catch (IOException ex)
{
log.Error("Could not open Servo Controller Port on " + portName, ex);
inactive = true;
}
}
示例13: CommandDatagram
public CommandDatagram()
{
this.type = (int) XPiPlaneConstants.DatagramTypes.COMMAND;
this.opcode = "CMND0";
log = LogManager.GetLogger(opcode.Substring(0, 4));
log.Debug("New XP Command Created");
}
示例14: DummyApiCommand
public DummyApiCommand(IOctopusRepositoryFactory repositoryFactory, ILog log, IOctopusFileSystem fileSystem)
: base(repositoryFactory, log, fileSystem)
{
var options = Options.For("Dummy");
options.Add("pill=", "Red or Blue. Blue, the story ends. Red, stay in Wonderland and see how deep the rabbit hole goes.", v => pill = v);
log.Debug ("Pill: " + pill);
}
示例15: Debug
/// <summary>
/// The debug.
/// </summary>
/// <param name="log">
/// The log.
/// </param>
/// <param name="message">
/// The message.
/// </param>
public static void Debug(ILog log, string message)
{
if (log != null && log.IsDebugEnabled)
{
log.Debug(message);
}
}