Generate file depend date
Hello.
I want to generate a file with the date. This following code work. But it doesn't generate a new file when the date change. It change only if the server restart or if the plugin is reloaded. Here's my code actualy. PHP Code:
But i don't know wich part of this original code is really needed for me. https://github.com/alliedmodders/sou...ogger.cpp#L360 |
Re: Generate file depend date
Post the full code because i don't see how you create files.
EDIT 1: Here are some examples how to write logs (if that's what you want) Code:
// Using LogToFile/LogToFileEx |
Re: Generate file depend date
Not updated with new declaration yet.
https://pastebin.com/LvqAkHqX |
Re: Generate file depend date
That's because you're doing it only in OnPluginStart which is called only once after server start or when you (re)load the plugin manually.
You should rebuild the path at least in OnMapStart which is called after every map change. The better way is to create a repeating timer (for example, with interval of 1 minute) and rebuild path in timer's callback. And the best way is to rebuild path before every LogToFile call which is slightly unoptimized but still fast enough. Code:
stock void LogToDateFile(const char[] message, any ...) { |
Re: Generate file depend date
Works ! Thanks :)
|
All times are GMT -4. The time now is 05:58. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.