mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-02 18:03:56 -04:00
Auto temp logfile path
This commit is contained in:
parent
7177e3d43a
commit
af7827c42a
@ -292,7 +292,24 @@ load_plugin(const string &p3d_plugin_filename) {
|
|||||||
// Successfully loaded.
|
// Successfully loaded.
|
||||||
plugin_loaded = true;
|
plugin_loaded = true;
|
||||||
|
|
||||||
|
#ifdef P3D_PLUGIN_LOGFILE2
|
||||||
string logfilename = P3D_PLUGIN_LOGFILE2;
|
string logfilename = P3D_PLUGIN_LOGFILE2;
|
||||||
|
#else
|
||||||
|
string logfilename;
|
||||||
|
#endif // P3D_PLUGIN_LOGFILE2
|
||||||
|
|
||||||
|
if (logfilename.empty()) {
|
||||||
|
#ifdef _WIN32
|
||||||
|
static const size_t buffer_size = 4096;
|
||||||
|
char buffer[buffer_size];
|
||||||
|
if (GetTempPath(buffer_size, buffer) != 0) {
|
||||||
|
logfilename = buffer;
|
||||||
|
logfilename += "panda3d.2.log";
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
logfilename = "/tmp/panda3d.2.log";
|
||||||
|
#endif // _WIN32
|
||||||
|
}
|
||||||
|
|
||||||
if (!P3D_initialize(P3D_API_VERSION, logfilename.c_str())) {
|
if (!P3D_initialize(P3D_API_VERSION, logfilename.c_str())) {
|
||||||
// Oops, failure to initialize.
|
// Oops, failure to initialize.
|
||||||
|
@ -347,6 +347,7 @@ subprocess_run() {
|
|||||||
}
|
}
|
||||||
_width = event.xconfigure.width;
|
_width = event.xconfigure.width;
|
||||||
_height = event.xconfigure.height;
|
_height = event.xconfigure.height;
|
||||||
|
override = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
double install_progress = _install_progress;
|
double install_progress = _install_progress;
|
||||||
|
@ -28,7 +28,25 @@ static bool logfile_is_open = false;
|
|||||||
static void
|
static void
|
||||||
open_logfile() {
|
open_logfile() {
|
||||||
if (!logfile_is_open) {
|
if (!logfile_is_open) {
|
||||||
logfile.open(P3D_PLUGIN_LOGFILE1);
|
#ifdef P3D_PLUGIN_LOGFILE1
|
||||||
|
string logfilename = P3D_PLUGIN_LOGFILE1;
|
||||||
|
#else
|
||||||
|
string logfilename;
|
||||||
|
#endif // P3D_PLUGIN_LOGFILE1
|
||||||
|
|
||||||
|
if (logfilename.empty()) {
|
||||||
|
#ifdef _WIN32
|
||||||
|
static const size_t buffer_size = 4096;
|
||||||
|
char buffer[buffer_size];
|
||||||
|
if (GetTempPath(buffer_size, buffer) != 0) {
|
||||||
|
logfilename = buffer;
|
||||||
|
logfilename += "panda3d.1.log";
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
logfilename = "/tmp/panda3d.1.log";
|
||||||
|
#endif // _WIN32
|
||||||
|
}
|
||||||
|
logfile.open(logfilename.c_str());
|
||||||
logfile_is_open = true;
|
logfile_is_open = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user