Class ContentBuildLogger
Provides methods for reporting informational messages or warnings from content importers and processors. Do not use this class to report errors. Instead, report errors by throwing a PipelineException or InvalidContentException.
public class ContentBuildLogger
- Inheritance
-
ContentBuildLogger
- Derived
- Inherited Members
Constructors
ContentBuildLogger()
Initializes a new instance of ContentBuildLogger.
public ContentBuildLogger()
Properties
IndentCharacter
A character to be used for indentation of Log(LogLevel, string) messages.
public char IndentCharacter { get; set; }
Property Value
IndentCharacterSize
Indicates how many of IndentCharacter should be used for indentation of Log(LogLevel, string) messages.
public uint IndentCharacterSize { get; set; }
Property Value
IndentString
Creates a string that is the combination of IndentCharacter * Indent() * IndentCharacterSize.
protected string IndentString { get; }
Property Value
LoggerRootDirectory
Gets or sets the base reference path used when reporting errors during the content build process.
public string LoggerRootDirectory { get; set; }
Property Value
ShowRealTime
Indicates if the log should should current time with each logged message as opposed to the time since the logging started.
public bool ShowRealTime { get; set; }
Property Value
- bool
false
by default.
Methods
GetCurrentFilename(ContentIdentity?)
Gets the filename currently being processed, for use in warning and error messages.
public string GetCurrentFilename(ContentIdentity? contentIdentity = null)
Parameters
contentIdentity
ContentIdentityIdentity of a content item. If specified, GetCurrentFilename uses this value to refine the search. If no value is specified, the current PushFile state is used.
Returns
- string
Name of the file being processed.
Indent()
Adds an indent for all future Log calls.
public virtual void Indent()
Log(LogLevel, string)
Outputs a message from the content system with the specified log level.
public virtual void Log(LogLevel level, string message)
Parameters
Log(string)
Outputs a message from the content system with the Info log level.
public void Log(string message)
Parameters
message
string
LogImportantMessage(string, params object[])
Outputs a high-priority status message from the content system.
[Obsolete("LogImportantMessage is deprecated, please use Log instead.")]
public virtual void LogImportantMessage(string message, params object[] messageArgs)
Parameters
LogMessage(string, params object[])
Outputs a low priority status message from the content system.
[Obsolete("LogMessage is deprecated, please use Log instead.")]
public virtual void LogMessage(string message, params object[] messageArgs)
Parameters
LogWarning(string, ContentIdentity, string, params object[])
Outputs a warning message from the content system.
[Obsolete("LogWarning is deprecated, please use Log instead.")]
public virtual void LogWarning(string helpLink, ContentIdentity contentIdentity, string message, params object[] messageArgs)
Parameters
helpLink
stringLink to an existing online help topic containing related information.
contentIdentity
ContentIdentityIdentity of the content item that generated the message.
message
stringMessage being reported.
messageArgs
object[]Arguments for the reported message.
PopFile()
Outputs a message indicating that a content asset has completed processing.
public virtual void PopFile()
PushFile(string)
Outputs a message indicating that a content asset has begun processing. All logger warnings or error exceptions from this time forward to the next PopFile call refer to this file.
public virtual void PushFile(string filename)
Parameters
filename
stringName of the file containing future messages.
Unindent()
Removes an indent for all future Log calls.
public virtual void Unindent()