本文整理汇总了C#中Logger类的典型用法代码示例。如果您正苦于以下问题:C# Logger类的具体用法?C# Logger怎么用?C# Logger使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Logger类属于命名空间,在下文中一共展示了Logger类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GitWrapper
public GitWrapper(string outputDirectory, Logger logger, Encoding commitEncoding,
bool forceAnnotatedTags)
: base(outputDirectory, logger, gitExecutable, gitMetaDir)
{
this.commitEncoding = commitEncoding;
this.forceAnnotatedTags = forceAnnotatedTags;
}
示例2: TorznabController
public TorznabController(IIndexerManagerService i, Logger l, IServerService s, ICacheService c)
{
indexerService = i;
logger = l;
serverService = s;
cacheService = c;
}
示例3: AssemblyResolver
public AssemblyResolver(WeavingTask config, Logger logger, BuildEnginePropertyExtractor buildEnginePropertyExtractor)
{
this.config = config;
this.logger = logger;
this.buildEnginePropertyExtractor = buildEnginePropertyExtractor;
assemblyDefinitionCache = new Dictionary<string, AssemblyDefinition>(StringComparer.OrdinalIgnoreCase);
}
示例4: PirateTheNet
public PirateTheNet(IIndexerManagerService i, Logger l, IWebClient w, IProtectionService ps)
: base(name: "PirateTheNet",
description: "A movie tracker",
link: "http://piratethe.net/",
caps: new TorznabCapabilities(),
manager: i,
client: w,
logger: l,
p: ps,
configData: new ConfigurationDataBasicLoginWithRSSAndDisplay())
{
Encoding = Encoding.GetEncoding("UTF-8");
Language = "en-us";
this.configData.DisplayText.Value = "Only the results from the first search result page are shown, adjust your profile settings to show the maximum.";
this.configData.DisplayText.Name = "Notice";
AddCategoryMapping("1080P", TorznabCatType.MoviesHD);
AddCategoryMapping("720P", TorznabCatType.MoviesHD);
AddCategoryMapping("BDRip", TorznabCatType.MoviesSD);
AddCategoryMapping("BluRay", TorznabCatType.MoviesBluRay);
AddCategoryMapping("BRRip", TorznabCatType.MoviesSD);
AddCategoryMapping("DVDR", TorznabCatType.MoviesDVD);
AddCategoryMapping("DVDRip", TorznabCatType.MoviesSD);
AddCategoryMapping("FLAC", TorznabCatType.AudioLossless);
AddCategoryMapping("MP3", TorznabCatType.AudioMP3);
AddCategoryMapping("MP4", TorznabCatType.AudioOther);
AddCategoryMapping("Packs", TorznabCatType.Movies);
AddCategoryMapping("R5", TorznabCatType.MoviesDVD);
AddCategoryMapping("Remux", TorznabCatType.Movies);
AddCategoryMapping("TVRip", TorznabCatType.MoviesOther);
AddCategoryMapping("WebRip", TorznabCatType.MoviesWEBDL);
}
示例5: Main
static void Main()
{
Logger logger = new Logger(new FileAppender(new SimpleLayout(), "log.txt"));
logger.Critical("asdasd");
logger.Warn("asdasd");
logger.Info("asdasd");
}
示例6: ExamplePrograms
public ExamplePrograms()
{
var loggerNamePattern = "BitSharp.Examples.*";
var logLevel = LogLevel.Info;
// log layout format
var layout = "${message} ${exception:separator=\r\n:format=message,type,method,stackTrace:maxInnerExceptionLevel=10:innerExceptionSeparator=\r\n:innerFormat=message,type,method,stackTrace}";
// initialize logging configuration
var config = new LoggingConfiguration();
// create console target
var consoleTarget = new ColoredConsoleTarget();
consoleTarget.Layout = layout;
config.AddTarget("console", consoleTarget);
config.LoggingRules.Add(new LoggingRule(loggerNamePattern, logLevel, consoleTarget));
// create debugger target, if attached
if (Debugger.IsAttached)
{
var debuggerTarget = new DebuggerTarget();
debuggerTarget.Layout = layout;
config.AddTarget("debugger", debuggerTarget);
config.LoggingRules.Add(new LoggingRule(loggerNamePattern, logLevel, debuggerTarget));
}
LogManager.Configuration = config;
logger = LogManager.GetCurrentClassLogger();
}
示例7: ImmortalSeed
public ImmortalSeed(IIndexerManagerService i, IWebClient wc, Logger l)
: base(name: "ImmortalSeed",
description: "ImmortalSeed",
link: "http://immortalseed.me/",
caps: TorznabCapsUtil.CreateDefaultTorznabTVCaps(),
manager: i,
client: wc,
logger: l)
{
AddCategoryMapping(32, TorznabCatType.Anime);
AddCategoryMapping(47, TorznabCatType.TVSD);
AddCategoryMapping(8, TorznabCatType.TVHD);
AddCategoryMapping(48, TorznabCatType.TVHD);
AddCategoryMapping(9, TorznabCatType.TVSD);
AddCategoryMapping(4, TorznabCatType.TVHD);
AddCategoryMapping(6, TorznabCatType.TVSD);
AddCategoryMapping(22, TorznabCatType.Books);
AddCategoryMapping(41, TorznabCatType.Comic);
AddCategoryMapping(23, TorznabCatType.Apps);
AddCategoryMapping(16, TorznabCatType.MoviesHD);
AddCategoryMapping(17, TorznabCatType.MoviesSD);
AddCategoryMapping(14, TorznabCatType.MoviesSD);
AddCategoryMapping(34, TorznabCatType.MoviesForeign);
AddCategoryMapping(18, TorznabCatType.MoviesForeign);
AddCategoryMapping(33, TorznabCatType.MoviesForeign);
AddCategoryMapping(34, TorznabCatType.Audio);
AddCategoryMapping(37, TorznabCatType.AudioLossless);
AddCategoryMapping(35, TorznabCatType.AudioBooks);
AddCategoryMapping(36, TorznabCatType.AudioLossy);
}
示例8: NLogLogger
public NLogLogger(Logger logger)
{
if (logger == null)
throw new ArgumentNullException("logger");
this.logger = logger;
}
示例9: ArduiPort
public ArduiPort(string name, int baud, Logger logger)
{
_Logger = logger;
_port = new SerialPort(name, baud);
SetName(name);
SetBaudRate(baud);
}
示例10: ScanWatchFolder
public ScanWatchFolder(ICacheManager cacheManager, IDiskScanService diskScanService, IDiskProvider diskProvider, Logger logger)
{
_logger = logger;
_diskProvider = diskProvider;
_diskScanService = diskScanService;
_watchFolderItemCache = cacheManager.GetCache<Dictionary<string, WatchFolderItem>>(GetType());
}
示例11: Language
public Language(Konfiguration cfg, Logger log)
{
this.config = cfg;
this.logger = log;
this.parser = new LanguageParser(this.config, this.logger);
}
示例12: BitHdtv
public BitHdtv(IIndexerManagerService i, Logger l, IWebClient w, IProtectionService ps)
: base(name: "BIT-HDTV",
description: "Home of high definition invites",
link: "https://www.bit-hdtv.com/",
caps: new TorznabCapabilities(),
manager: i,
client: w,
logger: l,
p: ps,
configData: new ConfigurationDataBasicLogin())
{
Encoding = Encoding.GetEncoding("iso-8859-1");
Language = "en-us";
AddCategoryMapping(1, TorznabCatType.TVAnime); // Anime
AddCategoryMapping(2, TorznabCatType.MoviesBluRay); // Blu-ray
AddCategoryMapping(4, TorznabCatType.TVDocumentary); // Documentaries
AddCategoryMapping(6, TorznabCatType.AudioLossless); // HQ Audio
AddCategoryMapping(7, TorznabCatType.Movies); // Movies
AddCategoryMapping(8, TorznabCatType.AudioVideo); // Music Videos
AddCategoryMapping(5, TorznabCatType.TVSport); // Sports
AddCategoryMapping(10, TorznabCatType.TV); // TV
AddCategoryMapping(12, TorznabCatType.TV); // TV/Seasonpack
AddCategoryMapping(11, TorznabCatType.XXX); // XXX
}
示例13: 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
}
示例14: MainForm
public MainForm(string[] args)
{
InitializeComponent();
logger = LogManager.GetLogger("");
logger.Log(LogLevel.Info, "Starting up...");
btnExit.Click += delegate { Exit(); };
btnMinimize.Click += delegate { ShowHide(); };
showHideToolStripMenuItem.Click += delegate { ShowHide(); };
exitToolStripMenuItem.Click += delegate { Exit(); };
notifyIcon.Text = Program.FullName;
this.Text = Program.FullName;
model = new Model(this.components, logger);
HookModel();
if (!model.Initialize())
{
this.Close();
//Application.Exit();
}
PopulateFolderList();
if (args.Length > 0)
{
if (!model.LoadTorrent(args[0]))
errorOnLoad = true;
}
}
示例15: DownloadService
public DownloadService(IProvideDownloadClient downloadClientProvider,
IEventAggregator eventAggregator, Logger logger)
{
_downloadClientProvider = downloadClientProvider;
_eventAggregator = eventAggregator;
_logger = logger;
}