Table of Contents

Class ContentBuildLogger

Namespace
Microsoft.Xna.Framework.Content.Pipeline
Assembly
MonoGame.Framework.Content.Pipeline.dll

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

char

IndentCharacterSize

Indicates how many of IndentCharacter should be used for indentation of Log(LogLevel, string) messages.

public uint IndentCharacterSize { get; set; }

Property Value

uint

IndentString

Creates a string that is the combination of IndentCharacter * Indent() * IndentCharacterSize.

protected string IndentString { get; }

Property Value

string

LoggerRootDirectory

Gets or sets the base reference path used when reporting errors during the content build process.

public string LoggerRootDirectory { get; set; }

Property Value

string

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 ContentIdentity

Identity 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

level LogLevel

Log level of the message.

message string

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

message string

Message being reported.

messageArgs object[]

Arguments for the reported message.

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

message string

Message being reported.

messageArgs object[]

Arguments for the reported message.

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 string

Link to an existing online help topic containing related information.

contentIdentity ContentIdentity

Identity of the content item that generated the message.

message string

Message 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 string

Name of the file containing future messages.

Unindent()

Removes an indent for all future Log calls.

public virtual void Unindent()