The Overlayed logging module provides comprehensive file and console logging for your application.

About

  • Logs are saved to files in your application’s log directory
    • %APPDATA%\overlayed\<applicationId>\logs
  • Logs are saved to files based on date
  • Logs are automatically deleted after 7 days

Log Levels

The logging module supports multiple log levels:
  • debug - Detailed information for debugging purposes
  • info - General information about application state
  • warn - Warnings that don’t stop execution but should be noted
  • error - Errors that may affect functionality

Using the Logger

Basic Logging

overlay.logger.debug("Overlay initialized successfully");
overlay.logger.info("Game session started", { gameId: "siege" });
overlay.logger.warn("High memory usage detected", { usage: "85%" });
overlay.logger.error("Failed to load game module", { error: errorDetails });
When log arguments are written to file, they’re processed with JSON.stringify().

Infinite Arguments

All log methods accept an infinite number of arguments.
overlay.logger.info(
	"Player action performed",
	{
		playerId: "player123",
		action: "kill",
		timestamp: Date.now(),
		gameMode: "ranked",
	},
    {
        someAdditionalData: "someValue",
    }
});

File Output

Logs are also written to files in your application’s log directory:
  • app.log - Your application’s logs
  • main.log - Overlayed’s logs

Bug Reports

To facilitate user-driven bug reports or automatic bug reports, you can use the bugReport method. Bug reports can then be viewed in your Overlayed dashboard.
overlay.logger.bugReport({
	email: "user@example.com",
	message: "The overlay is not working",
});

Additional Files

If you have your own data to include in the bug report, for example the current stored state of a match, you can pass it as an object with the additionalFiles property:
overlay.logger.bugReport(
	{
		email: "user@example.com",
	},
	{
		additionalFiles: {
			"gameState.json": JSON.stringify(myGameState),
		},
	}
);

Debug Mode

Enabling

Debug mode can be enabled in your OverlayedOptions configuration:
import { overlayed } from "@overlayed/app";

const overlay = overlayed({
	debug: process.env.NODE_ENV === "development",
});
When enabled, the following additional features are available:
  • logger.debug() logs will be printed and saved to the log file
  • Logs from Overlayed’s internals will be logged to the console