本文整理汇总了C#中log4net.ILog.Debug方法的典型用法代码示例。如果您正苦于以下问题:C# log4net.ILog.Debug方法的具体用法?C# log4net.ILog.Debug怎么用?C# log4net.ILog.Debug使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类log4net.ILog
的用法示例。
在下文中一共展示了log4net.ILog.Debug方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: WriteLog
public void WriteLog(LogEnum name, LogLevel level, string logContent)
{
log = log4net.LogManager.GetLogger(name.ToString());
//log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
switch (level)
{
case LogLevel.DEBUG:
log.Debug(logContent);
break;
case LogLevel.ERROR:
log.Error(logContent);
break;
case LogLevel.FATAL:
log.Fatal(logContent);
break;
case LogLevel.INFO:
log.Info(logContent);
break;
case LogLevel.WARN:
log.Warn(logContent);
break;
default:
log.Debug(logContent);
break;
}
}
示例2: Protocol
/// <summary>
/// Initialize a new instance of <see cref="Protocol" />.
/// </summary>
/// <param name="server">Server address to connect to.</param>
/// <param name="port">Server port.</param>
public Protocol(string server, int port)
{
_log = LogManager.GetLogger(this);
_log.Debug("Connecting to server.");
_tcpClient = new TcpClient();
_tcpClient.Connect(server, port);
_log.Debug("Getting stream.");
_stream = _tcpClient.GetStream();
_log.Debug("Initializing tools.");
_tools = new NetworkTools(_stream);
}
示例3: PacketListener
public PacketListener(Protocol protocol)
{
_log = LogManager.GetLogger(this);
_log.Debug("Setting protocol...");
_protocol = protocol;
_log.Debug("Creating packet listen thread...");
_listenThread = new Thread(ReadPackets) {Name = "PacketListen", IsBackground = true};
_log.Debug("Starting packet listen thread...");
_running = true;
_listenThread.Start();
_log.Info("Packet listen thread started!");
}
示例4: DebugDisplay
/// <summary>
/// Initialize a new instance of <c>DebugDisplay</c>.
/// </summary>
/// <param name="game">The game instance.</param>
/// <param name="graphics">The graphics device manager.</param>
internal DebugDisplay(Game game, GraphicsDeviceManager graphics)
: base(game)
{
_log = LogManager.GetLogger(this);
_log.Debug("DebugDisplay created!");
_graphics = graphics;
_content = new ContentManager(game.Services, Constants.ContentDirectory);
_log.Debug("Creating FrameRateDisplay...");
game.Components.Add(new FrameRateDisplay(game));
_log.Debug("Creating UserInfoDisplay...");
game.Components.Add(new UserInfoDisplay(game));
game.Exiting += (s, e) => UnloadContent();
}
示例5: AudioManager
public AudioManager(bool hardware = true)
{
_log = Logging.LogManager.GetLogger(this);
_log.Info("Initializing AudioManager...");
_log.Info("Creating FMOD system...");
uint version = 0;
RESULT result = Factory.System_Create(ref _system);
ErrCheck(result);
_log.Debug("Checking FMOD version...");
result = _system.getVersion(ref version);
ErrCheck(result);
if (version < VERSION.number)
{
var msg = string.Format("Error! You are using an old version of FMOD: {0}. This program requires: {1}.",
version.ToString("X"), VERSION.number.ToString("X"));
_log.Fatal(msg);
throw new FMODException(msg);
}
result = _system.init(MaxChannels, INITFLAGS.NORMAL, (IntPtr) null);
ErrCheck(result);
_soundManager = new SoundManager(_system, hardware);
_songManager = new SongManager(_system, hardware);
_log.Info("AudioManager initialized!");
}
示例6: TextManager
public TextManager(Map map)
{
_log = Logging.LogManager.GetLogger(this);
_log.Info("TextManager is loading map text entries...");
_texts = new List<Text>();
_activeText = null;
if (!map.HasLayer("text"))
{
_log.Info("No text layer detected on map, aborting...");
return;
}
foreach (var obj in map.FindObjects((l, o) => l.Name == "text"))
{
string title = obj.Properties.ContainsKey("title") ? obj.Properties["title"] : "<No Title>";
string subtitle = obj.Properties.ContainsKey("subtitle") ? obj.Properties["subtitle"] : null;
_log.DebugFormat("Adding new text {0} of type {1}", obj.Name, obj.Type);
_texts.Add(new Text(obj.Bounds, obj.Name, obj.Type, title, subtitle));
}
_log.Debug("TextManager initialized!");
}
示例7: GoogleMapsEngineAPI
/*
* Constructor for Google Maps API utilities
*/
public GoogleMapsEngineAPI(ref log4net.ILog log)
{
// establish the Google APIs project key
this.GOOGLE_API_KEY = Properties.Settings.Default.gme_api_key;
// establish the Google Maps Engine API settings
this.GME_API_PROTOCOL = Properties.Settings.Default.gme_api_protocol;
this.GME_API_DOMAIN = Properties.Settings.Default.gme_api_domain;
this.GME_API_SERVICE = Properties.Settings.Default.gme_api_service;
this.GME_API_VERSION = Properties.Settings.Default.gme_api_version;
// set the log
this.log = log;
// retrieve a reference to the extension
log.Debug("Retrieiving a reference to the extension object.");
ext = GoogleMapsEngineToolsExtensionForArcGIS.GetExtension();
// create a Google Maps Engine Session Id for this set of sessions
GoogleMapsEngineAPISessionId = Guid.NewGuid();
// if debug, create a debug folder to keep track of information
if (log.IsDebugEnabled)
{
// create a temporary folder
debugDirectory = System.IO.Directory.CreateDirectory(
ext.getLocalWorkspaceDirectory()
+ "\\GME_API_TMP_"
+ GoogleMapsEngineAPISessionId.ToString().Replace("-",""));
}
}
示例8: FrameRateDisplay
internal FrameRateDisplay(Game game)
: base(game)
{
_log = LogManager.GetLogger(this);
_log.Debug("FrameRateDisplay created!");
_content = new ContentManager(game.Services, Constants.ContentDirectory);
game.Exiting += (s, e) => UnloadContent();
}
示例9: BaseGameState
protected BaseGameState(Game game, GameStateManager manager)
: base(game, manager)
{
Log = LogManager.GetLogger(this);
Log.Debug("Constructing GameState... (" + GetType() + ")");
Log = LogManager.GetLogger(this);
GameRef = (MainGame) game;
PlayerIndexInControl = PlayerIndex.One;
}
示例10: UserInfoDisplay
internal UserInfoDisplay(Game game)
: base(game)
{
_log = LogManager.GetLogger(this);
_log.Debug("UserInfoDisplay created!");
_sc = (Sharpcraft) game;
_content = new ContentManager(game.Services, Constants.ContentDirectory);
game.Exiting += (s, e) => UnloadContent();
}
示例11: CheckBaseData
static CheckBaseData()
{
log = log4net.LogManager.GetLogger(typeof(CheckBaseData));
#if !DEBUG
tmr = new System.Timers.Timer(1000 * 20) { AutoReset = false };
tmr.Elapsed += tmr_Elapsed;
tmr.Start();
log.Debug("开始");
#endif
}
示例12: SoundManager
internal SoundManager(FMOD.System system, bool hardware = true)
{
_log = Logging.LogManager.GetLogger(this);
_log.Info("Initializing SoundManager...");
_system = system;
_sounds = new List<Sound>();
_soundMode = hardware ? MODE.HARDWARE : MODE.SOFTWARE;
_log.DebugFormat("Sound Mode == {0}", _soundMode);
_log.Debug("SoundManager initialized!");
}
示例13: Client
/// <summary>
/// Initialize a new Minecraft client.
/// </summary>
/// <param name="server">The server to connect to.</param>
/// <param name="player">The player who logged in with the client.</param>
public Client(Server server, Player player)
{
_log = LogManager.GetLogger(this);
_log.Debug("Minecraft Client created!");
_server = server;
_log.Debug("Loading Items from file...");
try
{
using (var reader = new StreamReader(Constants.MinecraftItemFile))
Items = new JsonSerializer().Deserialize<List<Item>>(new JsonTextReader(reader));
}
catch(IOException ex)
{
_log.Error("Failed to read item list from file!");
_log.Error(ex.GetType() + ": " + ex.Message);
_log.Error("Stack Trace:\n" + ex.StackTrace);
throw new Exception("Sharpcraft.Library.Minecraft.Client failed to initialize! Could not read item list file!", ex);
}
_log.Debug("Creating communication protocol...");
_protocol = new Protocol(_server.Address, _server.Port);
_log.Info("Client initiated on " + _server.Address + ":" + _server.Port + "!");
_player = player;
_world = new World();
}
示例14: SongManager
internal SongManager(FMOD.System system, bool hardware = true)
{
_log = Logging.LogManager.GetLogger(this);
_log.Info("Initializing SongManager...");
_system = system;
_songs = new List<Song>();
// ReSharper disable BitwiseOperatorOnEnumWihtoutFlags
if (hardware)
_soundMode = MODE._2D | MODE.HARDWARE | MODE.CREATESTREAM;
else
_soundMode = MODE._2D | MODE.SOFTWARE | MODE.CREATESTREAM;
// ReSharper restore BitwiseOperatorOnEnumWihtoutFlags
_log.DebugFormat("Sound Mode == {0}", _soundMode);
_log.Debug("SongManager initialized!");
}
示例15: ControlsManager
internal ControlsManager(string file)
{
_log = LogManager.GetLogger(this);
if (File.Exists(file))
{
_log.Info("Loading controls from " + file + "...");
Controls = Serializer.JsonDeserialize<Controls>(file);
_log.Debug("Controls loaded!");
}
else
{
Controls = new Controls();
SetDefaultControls();
_log.Debug("Saving controls to " + SettingsFile + "...");
Serializer.JsonSerialize(Controls, SettingsFile);
}
CheckControls();
}