Raised This Month: $12 Target: $400
 3% 

To add server port number to log file name


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
jevgienij
Junior Member
Join Date: Nov 2018
Old 12-25-2018 , 07:02   To add server port number to log file name
Reply With Quote #1

I host multiple Insurgency servers using one installation. This works fine but there is a problem when it comes to logging anything of sourcemod plugins. The logs are mixed into one file and you can't determine which server the given log line belongs to. I took SaveChat plugin as an example. I just want the log file name to contain server port number, this way a separate file should be created for each server, solving the problem. I'm just completely new to sourcemod scripting. I tried this:


https://www.diffchecker.com/zy0wDj2d

It compiles with no error but the file name is chat251218-‡i.log but I want it to be chat251218-27015.log as 27015 is that server's port number.

What am I doing wrong?

Last edited by jevgienij; 12-25-2018 at 07:04.
jevgienij is offline
DJ Tsunami
DJ Post Spammer
Join Date: Feb 2008
Location: The Netherlands
Old 12-25-2018 , 07:35   Re: To add server port number to log file name
Reply With Quote #2

You need to use %d (or %i) in the format string for the port number.
__________________
Advertisements | REST in Pawn - HTTP client for JSON REST APIs
Please do not PM me with questions. Post in the plugin thread.
DJ Tsunami is offline
jevgienij
Junior Member
Join Date: Nov 2018
Old 12-25-2018 , 08:22   Re: To add server port number to log file name
Reply With Quote #3

That's it, thanks!
jevgienij is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 17:22.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode