Package mars.assembler.log
Class LogMessage
java.lang.Object
mars.assembler.log.LogMessage
Represents occurrence of an error detected during tokenizing, assembly or simulation.
- Author:
- Pete Sanderson, August 2003; Sean Clarke, October 2024
-
Constructor Summary
ConstructorsConstructorDescriptionLogMessage(LogLevel level, SourceLocation location, String content) Create a newLogMessage. -
Method Summary
Modifier and TypeMethodDescriptionstatic LogMessageerror(SourceLocation location, String content) Create a newLogMessagewith levelLogLevel.ERROR.Get the textual content of this message.getLevel()Get the level of this message.Get the location in the source code this message refers to.static LogMessageinfo(SourceLocation location, String content) Create a newLogMessagewith levelLogLevel.INFO.toString()Convert this message to a string for the purpose of displaying to the user.static LogMessagewarning(SourceLocation location, String content) Create a newLogMessagewith levelLogLevel.WARNING.
-
Constructor Details
-
LogMessage
Create a newLogMessage.- Parameters:
level- The level of the message.location- The location in the source code the message refers to.content- The textual content of the message.
-
-
Method Details
-
info
Create a newLogMessagewith levelLogLevel.INFO.- Parameters:
location- The location in the source code the message refers to.content- The textual content of the message.
-
warning
Create a newLogMessagewith levelLogLevel.WARNING.- Parameters:
location- The location in the source code the message refers to.content- The textual content of the message.
-
error
Create a newLogMessagewith levelLogLevel.ERROR.- Parameters:
location- The location in the source code the message refers to.content- The textual content of the message.
-
getLevel
Get the level of this message.- Returns:
- The level of this message.
-
getLocation
Get the location in the source code this message refers to.- Returns:
- The location in the source code this message refers to, or
nullif this message does not reference any particular location in the source code.
-
getContent
Get the textual content of this message.- Returns:
- The textual content of this message.
-
toString
Convert this message to a string for the purpose of displaying to the user. This string representation may take up multiple lines, but does not end with a newline.
-