本文整理汇总了C#中Verbosity类的典型用法代码示例。如果您正苦于以下问题:C# Verbosity类的具体用法?C# Verbosity怎么用?C# Verbosity使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Verbosity类属于命名空间,在下文中一共展示了Verbosity类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Write
public void Write(Verbosity verbosity, LogLevel level, string format, params object[] args)
{
if (verbosity > Verbosity)
{
return;
}
lock (_lock)
{
try
{
var palette = _palettes[level];
var tokens = FormatParser.Parse(format);
foreach (var token in tokens)
{
SetPalette(token, palette);
_console.Write("{0}", token.Render(args));
}
}
finally
{
_console.ResetColor();
_console.WriteLine();
}
}
}
示例2: CreateUser
public static string CreateUser(Geocode geocode, bool debugEnabled, Verbosity verbosity, List<string> fields)
{
var url = new Url(UserServiceBase);
url.Append("create");
HandleDefaults(url, geocode, debugEnabled, verbosity, fields);
return url.ToString();
}
示例3: WriteInfo
public static void WriteInfo(Verbosity vLevel, string message)
{
if(vLevel < verbosityLevel)
return;
infoLog.WriteLine(DateTime.Now + ":" + message);
}
示例4: Init
public static void Init(Verbosity verbosity, TextWriter ilog, TextWriter glog, TextWriter elog)
{
verbosityLevel = verbosity;
infoLog = ilog;
gameLog = glog;
errorLog = elog;
}
示例5: CakeBuildLog
public CakeBuildLog(IConsole console, Verbosity verbosity = Verbosity.Normal)
{
_console = console;
_lock = new object();
_palettes = CreatePalette();
Verbosity = verbosity;
}
示例6: Logger
public Logger(Stream stream, Verbosity? verbosity = null)
: this(verbosity)
{
if (!Attach(stream)) {
Debug("Failed to attach stream for logging.");
}
}
示例7: SetStatusText
internal void SetStatusText( Verbosity verbosity, string text )
{
StatusUpdate del = delegate
{
this.toolStripStatusLabel1.Text = text;
switch( verbosity )
{
case Verbosity.Critical:
this.toolStripStatusLabel1.ForeColor = Color.Red;
break;
default:
case Verbosity.Normal:
this.toolStripStatusLabel1.ForeColor = SystemColors.ControlText;
break;
case Verbosity.Verbose:
this.toolStripStatusLabel1.ForeColor = Color.Green;
break;
case Verbosity.Everything:
this.toolStripStatusLabel1.ForeColor = Color.Blue;
break;
}
};
if( this.InvokeRequired == true )
this.Invoke( del, verbosity, text );
else
del( verbosity, text );
}
示例8: Log
public static void Log(Verbosity verbosity,string format, params object[] arg0)
{
if ((int)verbosity >= (int)CurrentVerbosity)
{
Console.WriteLine(String.Format("{0}: ", verbosity.ToString()) + format, arg0);
}
}
示例9: LogEntry
public LogEntry(string message, Verbosity verbosity = Verbosity.Info)
: this()
{
VerbosityLevel = verbosity;
Timestamp = DateTime.Now;
Message = message ?? string.Empty;
}
示例10: CreateArticle
public static string CreateArticle(string type, Geocode geocode, bool debugEnabled, Verbosity verbosity, List<string> fields)
{
var url = new Url(ArticleServiceBase);
url.Append(type);
HandleDefaults(url, geocode, debugEnabled, verbosity, fields);
return url.ToString();
}
示例11: LogMessage
public void LogMessage(string message, Severity severity, Verbosity verbosity)
{
foreach (ILogWriter logWriter in this.writers)
{
logWriter.Log(severity, verbosity, message);
}
}
示例12: WriteLine
public void WriteLine(Verbosity verbosity, string format, params object[] args)
{
if (Console.KeyAvailable)
{
var ki = Console.ReadKey(true);
switch (ki.Key)
{
case ConsoleKey.D0:
case ConsoleKey.D1:
case ConsoleKey.D2:
case ConsoleKey.D3:
case ConsoleKey.D4:
case ConsoleKey.D5:
var nv = (Verbosity)(ki.Key - ConsoleKey.D0);
Verbosity = nv;
Console.Clear();
break;
default:
break;
}
}
if (Verbosity >= verbosity)
Console.WriteLine(String.Format(String.Format("{0}: ", verbosity) + format, args));
if (LogfileVerbosity >= verbosity)
WriteLogFile(String.Format(String.Format("{0}: ", verbosity) + format, args), false);
}
示例13: DeleteArticle
public static string DeleteArticle(string type, string id, bool deleteConnections, Geocode location, bool enableDebug, Verbosity verbosity, List<string> fields)
{
var url = new Url(ArticleServiceBase).Append(type).Append(id);
if (deleteConnections == true)
url.QueryString["deleteconnections"] = "true";
HandleDefaults(url, location, enableDebug, verbosity, fields);
return url.ToString();
}
示例14: UpdateArticle
public static string UpdateArticle(string type, string id, int revision, Geocode geocode, bool enableDebug, Verbosity verbosity, List<string> fields)
{
var url = new Url(ArticleServiceBase).Append(type).Append(id);
if (revision > 0)
url.QueryString["revision"] = revision.ToString();
HandleDefaults(url, geocode, enableDebug, verbosity, fields);
return url.ToString();
}
示例15: WriteLine
public static void WriteLine(string value = null, Verbosity? minimumVerbosity = null)
{
if (minimumVerbosity == null || _verbosity >= minimumVerbosity)
{
_hasWritten = true;
System.Console.WriteLine(value);
}
}