added support for username variable for logging
This commit is contained in:
@@ -55,7 +55,7 @@ Edit `config.psd1` before deploying:
|
||||
| Key | Description | Default |
|
||||
|---|---|---|
|
||||
| `UNCPath` | Base UNC path for clip storage — username subfolder created automatically | `\\server\ITCaptures` |
|
||||
| `LogPath` | Base UNC path for script logs — username subfolder created automatically; each script writes its own log file | `\\server\ITLogs` |
|
||||
| `LogPath` | Directory path for script logs — supports `%USERNAME%` and other environment variables; each script writes its own log file | `\\server\ITLogs\%USERNAME%` |
|
||||
| `BufferSeconds` | Replay buffer duration in seconds | `120` |
|
||||
| `WebSocketPort` | OBS WebSocket port — must match `obs-config/plugin_config/obs-websocket/config.json` | `4455` |
|
||||
| `OBSExecutable` | Full path to `obs64.exe` on the target machine | `C:\Program Files\obs-studio\bin\64bit\obs64.exe` |
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
# Base UNC path for saved clips — a subfolder per username is created automatically
|
||||
UNCPath = '\\server\ITCaptures'
|
||||
|
||||
# Base UNC path for script logs — a subfolder per username is created automatically
|
||||
# Directory path for script logs — supports %USERNAME% and other environment variables
|
||||
# Each script writes its own log: OBSReplayBuffer.log, OBSReplayBuffer-Tray.log, OBSReplayBuffer-Save.log
|
||||
LogPath = '\\server\ITLogs'
|
||||
LogPath = '\\server\ITLogs\%USERNAME%'
|
||||
|
||||
# Replay buffer duration in seconds (120 = 2 minutes)
|
||||
BufferSeconds = 120
|
||||
|
||||
@@ -21,7 +21,7 @@ if ($Port -eq 0) {
|
||||
|
||||
# --- Start transcript logging ---
|
||||
try {
|
||||
$logDir = Join-Path $config.LogPath $env:USERNAME
|
||||
$logDir = [System.Environment]::ExpandEnvironmentVariables($config.LogPath)
|
||||
New-Item -ItemType Directory -Path $logDir -Force -ErrorAction SilentlyContinue | Out-Null
|
||||
Start-Transcript -Path (Join-Path $logDir 'OBSReplayBuffer-Save.log') -Append -ErrorAction Stop
|
||||
} catch {
|
||||
|
||||
@@ -15,7 +15,7 @@ Add-Type -AssemblyName System.Drawing
|
||||
# --- Start transcript logging ---
|
||||
try {
|
||||
$config = Import-PowerShellDataFile -Path (Join-Path $PSScriptRoot '..\config.psd1')
|
||||
$logDir = Join-Path $config.LogPath $env:USERNAME
|
||||
$logDir = [System.Environment]::ExpandEnvironmentVariables($config.LogPath)
|
||||
New-Item -ItemType Directory -Path $logDir -Force -ErrorAction SilentlyContinue | Out-Null
|
||||
Start-Transcript -Path (Join-Path $logDir 'OBSReplayBuffer-Tray.log') -Append -ErrorAction Stop
|
||||
} catch {
|
||||
|
||||
@@ -17,7 +17,7 @@ $config = Import-PowerShellDataFile -Path $configPath
|
||||
|
||||
# --- Start transcript logging ---
|
||||
try {
|
||||
$logDir = Join-Path $config.LogPath $env:USERNAME
|
||||
$logDir = [System.Environment]::ExpandEnvironmentVariables($config.LogPath)
|
||||
New-Item -ItemType Directory -Path $logDir -Force -ErrorAction SilentlyContinue | Out-Null
|
||||
Start-Transcript -Path (Join-Path $logDir 'OBSReplayBuffer.log') -Append -ErrorAction Stop
|
||||
} catch {
|
||||
@@ -69,6 +69,7 @@ Write-Host "$(Get-Date -Format 'yyyy-MM-dd HH:mm:ss') [INFO] Detected resolution
|
||||
$obsConfigRoot = "$env:APPDATA\obs-studio"
|
||||
$sourceConfig = Join-Path $PSScriptRoot '..\obs-config'
|
||||
|
||||
New-Item -ItemType Directory -Path $obsConfigRoot -Force | Out-Null
|
||||
Copy-Item -Path "$sourceConfig\global.ini" -Destination "$obsConfigRoot\global.ini" -Force
|
||||
|
||||
$wsConfigDir = "$obsConfigRoot\plugin_config\obs-websocket"
|
||||
|
||||
Reference in New Issue
Block a user