Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
wendelin.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Kirill Smelkov
wendelin.core
Commits
a54b4f4c
Commit
a54b4f4c
authored
Feb 13, 2020
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
8af4d305
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
10 deletions
+11
-10
wcfs/client/wcfs.cpp
wcfs/client/wcfs.cpp
+2
-3
wcfs/client/wcfs_misc.cpp
wcfs/client/wcfs_misc.cpp
+5
-4
wcfs/client/wcfs_misc.h
wcfs/client/wcfs_misc.h
+4
-3
No files found.
wcfs/client/wcfs.cpp
View file @
a54b4f4c
...
...
@@ -171,9 +171,8 @@ error _Conn::_pinner(context::Context ctx) {
// print to stderr as well as by default log does not print to there.
// XXX also catch panic/exc ?
if
(
!
(
err
==
nil
||
errors
::
Is
(
err
,
context
::
canceled
)))
{
// canceled = .close asks pinner to stop
xlog
::
Fatalf
(
"CRITICAL: %s"
,
v
(
err
));
xlog
::
Fatalf
(
"CRITICAL: wcfs server will likely kill us soon."
);
log
::
Fatalf
(
"CRITICAL: %s"
,
v
(
err
));
log
::
Fatalf
(
"CRITICAL: wcfs server will likely kill us soon."
);
fprintf
(
stderr
,
"CRITICAL: %s
\n
"
,
v
(
err
));
fprintf
(
stderr
,
"CRITICAL: wcfs server will likely kill us soon.
\n
"
);
}
...
...
wcfs/client/wcfs_misc.cpp
View file @
a54b4f4c
...
...
@@ -247,8 +247,9 @@ error Contextf::operator() (error err) const {
#include <sys/types.h>
#include <sys/syscall.h>
// xlog::
namespace
xlog
{
// golang::log::
namespace
golang
{
namespace
log
{
void
__Logf
(
const
char
*
file
,
int
line
,
char
level
,
const
char
*
format
,
...)
{
double
t
=
time
::
now
();
...
...
@@ -263,7 +264,7 @@ void __Logf(const char *file, int line, char level, const char *format, ...) {
pid_t
tid
=
syscall
(
SYS_gettid
);
string
prefix
=
fmt
::
sprintf
(
"%c%s.%06d %d %s:%d] "
,
level
,
t_buf
,
t_us
,
tid
,
file
,
line
);
string
prefix
=
fmt
::
sprintf
(
"%c%s.%06d %
7
d %s:%d] "
,
level
,
t_buf
,
t_us
,
tid
,
file
,
line
);
// XXX better to emit prefix and msg in one go.
fprintf
(
stderr
,
"%s"
,
v
(
prefix
));
...
...
@@ -275,7 +276,7 @@ void __Logf(const char *file, int line, char level, const char *format, ...) {
fprintf
(
stderr
,
"
\n
"
);
}
}
// xlog
}
}
// golang::log::
// wcfs::
...
...
wcfs/client/wcfs_misc.h
View file @
a54b4f4c
...
...
@@ -168,13 +168,14 @@ public:
}
// xerr::
// xlog::
namespace
xlog
{
// golang::log:: TODO -> pygolang
namespace
golang
{
namespace
log
{
#define Fatalf(format, ...) __Logf(__FILE__, __LINE__, 'F', format, ##__VA_ARGS__)
void
__Logf
(
const
char
*
file
,
int
line
,
char
level
,
const
char
*
format
,
...);
}
// x
log::
}
}
// golang::
log::
// wcfs::
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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