Summary
Shared logging for Arma Reforger mod developers. Timestamped console and file output with configurable severity, debug filtering, prefix, and retention. Requires integration into your scripts.
Description
ScriptLogger
Shared Arma Reforger logging library by ForgedInFire. Project GUID: 69A33B096A810BA0. Requires only Arma Reforger (58D0FB3206B6F859).
Developer API
Add ScriptLogger as a project dependency and call:
FiF_SL_ScriptLogger.LogError("Unable to save loadout.", "FiF_SLV2_LoadoutStorage", "SaveLoadout");
FiF_SL_ScriptLogger.Log("Loadout saved.", "FiF_SLV2_LoadoutStorage", "SaveLoadout", LogLevel.NORMAL);
Both methods accept message, calling class, calling function, and optional severity. LogError defaults to ERROR; Log defaults to NORMAL. Class/function names are supplied by the caller, not discovered automatically. Installing the addon does not intercept other mods' Print calls.
Example (host-local time):
2026-09-20 10:00:00 [NORMAL] [FiF_Logger]::FiF_SLV2_LoadoutStorage::SaveLoadout::Loadout saved.
Configuration prefab
Prefabs/ScriptLogger/FiF_SL_ConfigEntity.et contains FiF_SL_ConfigComponent. Without a placed configuration entity, the mod spawns its default prefab after world processing. To override settings, place an instance in the scenario and name the entity FiF_SL_ConfigEntity. Alternatively, a dependent configuration addon can override the default prefab through Workbench. One effective configuration serves every caller in a process. Clients and the dedicated server have independent logger state and write to their own profiles; logs are not transmitted over the network. Configuration is not automatically replicated from a server-only dynamically placed entity.
Property
Default
Meaning
Console enabled
true
Send accepted entries to engine Print at their original severity
File enabled
true
Write accepted entries to a dedicated profile log
Debug enabled
false
Allow DEBUG, VERBOSE, SPAM; minimum severity still applies
Minimum level
NORMAL
Filter both outputs
Retention lines
10000
Retain newest lines, clamped to 1–100000
Relative path
FiF_Logs/ScriptLogger.log
Relative to $profile:, using forward slashes
Prefix
FiF_Logger
Brackets are normalized automatically
Engine console filters may further suppress Print output. The library does not relabel informational messages as warnings. Embedded newlines are escaped so each message occupies one retained line. Logging before configuration initialization uses safe defaults. A new world resets configuration. Runtime code can supply a FiF_SL_Settings instance through FiF_SL_ScriptLogger.Configure(settings).
File writes keep the newest configured number of lines, write a temporary file, then copy into place. A backup protects the previous destination during replacement failure; CopyFile is not atomic and power-loss recovery is not guaranteed. File failures are reported directly through Print to avoid recursion. Retention rewrites the bounded log per accepted file message; this is intended for diagnostic messages, not per-frame telemetry. Separate processes must use separate profiles/files.
Migration
This unpublished project's ID/title are now ScriptLogger; its GUID is unchanged. Replace FiF_SEH_ScriptLogger calls with FiF_SL_ScriptLogger. The old static configuration is replaced by the prefab and FiF_SL_Settings. No legacy alias is included. Core's FiF_ScriptLogger is a separate, older implementation; migrate Core callers and remove its duplicate implementation in the subsequent Core update. Loading Core is not part of standalone validation.
Standalone validation before publishing
Reopen ScriptLogger alone, without FiF_Core, and compile Game scripts with F7.
Load a test scenario and confirm automatic configuration prefab loading.
Verify console-only, file-only, both disabled, severity threshold and debug filtering.
Place the named configuration prefab, change prefix/path, and verify it overrides defaults.
Set retention to 3, write at least 5 messages, and verify only the newest 3 remain in order.
Restart and repeat retention testing against an existing log; test a large existing log too.
Switch worlds and verify settings reset. Confirm a file write failure reports an error without recursion.
Publish from Workbench only after these checks pass. Configure Workshop title as ScriptLogger.
License
Arma Public License (APL). Author: ForgedInFire. https://www.bohemia.net/community/licenses/arma-public-licenseLicense
Arma Public License (APL)