Class LogService
Object
LogService
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected EntityManager
Returns the entity manager of JPA.void
writeCommandLog
(Person person, String command) write a command to the database.void
writeDeputyLog
(Admin admin, String message) write a log message to the database.void
writeDeputyLog
(Admin admin, String message, String addendum) write a deputy log message to the database.void
write a log message to the database.void
write a log message to the database.void
write a log message to the database.void
write a log message to the database.void
writeLogException
(String message, Throwable throwable) write a log message of an exception to the database.void
writeLogException
(Throwable throwable) write a log message of an exception to the database.void
writeLogException
(Person person, String message, Throwable throwable) write a log message of an exception to the database.void
writeLogException
(Person person, Throwable throwable) write a log message of an exception to the database.
-
Constructor Details
-
LogService
public LogService()
-
-
Method Details
-
getEntityManager
protected EntityManager getEntityManager()Returns the entity manager of JPA. This is defined in build/web/WEB-INF/classes/META-INF/persistence.xml.- Returns:
- EntityManager
-
getLogs
-
writeDeputyLog
write a deputy log message to the database.- Parameters:
admin
- the deputy which has caused this log message.message
- the message to be written in the log, may not be larger than 255 characters or it will be truncated, and a second message will be logged mentioning this.addendum
- the rest of the message, can be large. Used for storing specifics regarding the logmessage.
-
writeDeputyLog
write a log message to the database. A simple general message.ø- Parameters:
admin
- the deputy which has caused this log message.message
- the message to be written in the log, may not be larger than 255 characters or it will be truncated, and a second message will be logged mentioning this.
-
writeLog
write a log message to the database. A simple general message.ø- Parameters:
message
- the message to be written in the log, may not be larger than 255 characters or it will be truncated, and a second message will be logged mentioning this.addendum
- the rest of the message, can be large. Used for storing specifics regarding the logmessage.
-
writeLog
write a log message to the database. A simple general message.ø- Parameters:
message
- the message to be written in the log, may not be larger than 255 characters or it will be truncated, and a second message will be logged mentioning this.
-
writeLog
write a log message to the database. This log facility is primarily used to keep a record of what kind of important mutations are done or attempted by both characters as well as administrators. Some examples:- an item is picked up off the floor by a character
- an item is eaten
- an administrator creates a new item/room/character
- Parameters:
person
- the person to be inscribed in the log table. May be null.message
- the message to be written in the log, may not be larger than 255 characters or it will be truncated, and a second message will be logged mentioning this.
-
writeLog
write a log message to the database. This log facility is primarily used to keep a record of what kind of important mutations are done or attempted by both characters as well as administrators. Some examples:- an item is picked up off the floor by a character
- an item is eaten
- an administrator creates a new item/room/character
- Parameters:
person
- the person to be inscribed in the log table. May be null.message
- the message to be written in the log, may not be larger than 255 characters or it will be truncated, and a second message will be logged mentioning this.addendum
- the rest of the message, can be large. Used for storing specifics regarding the logmessage.
-
writeLogException
-
writeLogException
-
writeLogException
-
writeLogException
write a log message of an exception to the database.- Parameters:
throwable
- the exception or error to be written to the log table.
-
writeCommandLog
write a command to the database. This log facility is primarily used to keep a chatrecord.- Parameters:
person
- the person to be inscribed in the log table. May be null.command
- the command that is to be executed written in the log, may not be larger than 255 characters.
-