The OPFSLogger
is a simple logging utility that writes log messages to a file in the browser using the OPFS storage system. It supports different log levels and timestamps each log entry.
Creates a new OPFSLogger
instance.
-
Parameters:
-
storage
: An instance of theOPFSStorage
class. -
fileName
(optional): The name of the log file. Defaults to"log.txt"
. -
dirName
(optional): The directory where the log file is located. If not provided, the file is created at the root level.
-
Writes a log message with a timestamp to the log file.
-
Parameters:
-
message
: The log message to write.
-
Writes an informational log message with a timestamp.
-
Parameters:
-
message
: The log message to write.
-
Writes a warning log message with a timestamp.
-
Parameters:
-
message
: The log message to write.
-
Writes an error log message with a timestamp.
-
Parameters:
-
message
: The log message to write.
-
Vyshnav - @vaishnavpk22
MIT