Class Log
java.lang.Object
com.ns.tcpframework.logger.Log
Represents a log entry with a specific log level, message, timestamp, and destination.
-
Constructor Summary
ConstructorsConstructorDescriptionLog(Loglevel level, String message, LogDestination destination) Constructs a new Log instance. -
Method Summary
-
Constructor Details
-
Log
Constructs a new Log instance.- Parameters:
level- The severity level of the log.message- The message content of the log.destination- The destination where the log will be sent.
-
-
Method Details
-
getLevel
-
getMessage
-
getDestination
Gets the timestamp of when the log was created.- Returns:
- The log timestamp in milliseconds since epoch.
-
toJson
public org.json.JSONObject toJson()Converts the log entry to a JSON object for structured logging.- Returns:
- A JSONObject representing the log entry.
-