info: | Download steam-boiler to install steam and boiler. |
---|---|
author: | Erik Southworth |
version: | 49 |
revision: | July 30, 2012 |
description: | Linux Reference Manual |
For some games, the srcds_run wrapper supports the extra option -consolelog <logname>. This launches a program called logger which is expected to be in the bin directory of your install. A simple redirection will not work to capture the console output because srcds_linux writes directly to the terminal not stdout.
The code for the logger script is below. It is a very simple expect wrapper. logger takes the path to the console log as the first argument. The next argument is assumed to be the server binary you want run (provided by srcds_run). The rest of the arguments are the run command-line arguments.
By using this, you are giving up the ability to interact with the console. That shouldn’t be an issue if you have netcon or rcon setup, which is a way to interact with servers.
#!/usr/bin/expect
# logger - srcds console logger
log_file [lindex $argv 0]
spawn [lindex $argv 1] [lrange $argv 2 $argc]
set timeout -1
expect
Maybe; if the server won’t write a logfile. Otherwise, if the server is working, just use the servers log generating facility. ( i.e. cvar +log on etc ...)