Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Donald Haase
Cockatrice
Commits
3f38e780
Commit
3f38e780
authored
Feb 04, 2015
by
Fabio Bas
Browse files
Fix #674
parent
cb50fd0e
Changes
1
Hide whitespace changes
Inline
Side-by-side
servatrice/src/server_logger.cpp
View file @
3f38e780
...
...
@@ -2,6 +2,8 @@
#include
"settingscache.h"
#include
<QSocketNotifier>
#include
<QFile>
#include
<QFileInfo>
#include
<QDir>
#include
<QTextStream>
#include
<QDateTime>
#include
<iostream>
...
...
@@ -26,8 +28,23 @@ ServerLogger::~ServerLogger()
void
ServerLogger
::
startLog
(
const
QString
&
logFileName
)
{
if
(
!
logFileName
.
isEmpty
())
{
QFileInfo
fi
(
logFileName
);
QDir
fileDir
(
fi
.
path
());
if
(
!
fileDir
.
exists
()
&&
!
fileDir
.
mkpath
(
fileDir
.
absolutePath
()))
{
std
::
cerr
<<
"ERROR: logfile folder doesn't exist and i can't create it."
<<
std
::
endl
;
logFile
=
0
;
return
;
}
logFile
=
new
QFile
(
logFileName
,
this
);
logFile
->
open
(
QIODevice
::
Append
);
if
(
!
logFile
->
open
(
QIODevice
::
Append
))
{
std
::
cerr
<<
"ERROR: can't open() logfile."
<<
std
::
endl
;
delete
logFile
;
logFile
=
0
;
return
;
}
#ifdef Q_OS_UNIX
::
socketpair
(
AF_UNIX
,
SOCK_STREAM
,
0
,
sigHupFD
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment