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 LogMessage
error
(SourceLocation location, String content) Create a newLogMessage
with 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 LogMessage
info
(SourceLocation location, String content) Create a newLogMessage
with levelLogLevel.INFO
.toString()
Convert this message to a string for the purpose of displaying to the user.static LogMessage
warning
(SourceLocation location, String content) Create a newLogMessage
with 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 newLogMessage
with levelLogLevel.INFO
.- Parameters:
location
- The location in the source code the message refers to.content
- The textual content of the message.
-
warning
Create a newLogMessage
with levelLogLevel.WARNING
.- Parameters:
location
- The location in the source code the message refers to.content
- The textual content of the message.
-
error
Create a newLogMessage
with 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
null
if 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.
-