Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
C
capnproto
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
capnproto
Commits
bdc568b8
Commit
bdc568b8
authored
Apr 14, 2013
by
Kenton Varda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tweak previous change.
parent
93e030e3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
12 deletions
+18
-12
exception.h
c++/src/capnproto/exception.h
+6
-0
logging.c++
c++/src/capnproto/logging.c++
+3
-3
logging.h
c++/src/capnproto/logging.h
+9
-9
No files found.
c++/src/capnproto/exception.h
View file @
bdc568b8
...
...
@@ -60,6 +60,12 @@ public:
Exception
(
const
Exception
&
other
)
noexcept
;
~
Exception
()
noexcept
;
const
char
*
getFile
()
const
{
return
file
;
}
int
getLine
()
const
{
return
line
;
}
Nature
getNature
()
const
{
return
nature
;
}
Durability
getDurability
()
const
{
return
durability
;
}
ArrayPtr
<
const
char
>
getDescription
()
const
{
return
description
;
}
const
char
*
what
()
const
noexcept
override
;
private
:
...
...
c++/src/capnproto/logging.c++
View file @
bdc568b8
...
...
@@ -126,7 +126,7 @@ static Array<char> makeDescription(const char* condition, const char* macroArgs,
}
}
void
Log
::
logInternal
(
const
char
*
file
,
u
int
line
,
Severity
severity
,
const
char
*
macroArgs
,
void
Log
::
logInternal
(
const
char
*
file
,
int
line
,
Severity
severity
,
const
char
*
macroArgs
,
ArrayPtr
<
Array
<
char
>>
argValues
)
{
getExceptionCallback
()
->
logMessage
(
str
(
severity
,
": "
,
file
,
":"
,
line
,
": "
,
...
...
@@ -134,7 +134,7 @@ void Log::logInternal(const char* file, uint line, Severity severity, const char
}
void
Log
::
recoverableFaultInternal
(
const
char
*
file
,
u
int
line
,
Exception
::
Nature
nature
,
const
char
*
file
,
int
line
,
Exception
::
Nature
nature
,
const
char
*
condition
,
const
char
*
macroArgs
,
ArrayPtr
<
Array
<
char
>>
argValues
)
{
getExceptionCallback
()
->
onRecoverableException
(
Exception
(
nature
,
Exception
::
Durability
::
PERMANENT
,
file
,
line
,
...
...
@@ -142,7 +142,7 @@ void Log::recoverableFaultInternal(
}
void
Log
::
fatalFaultInternal
(
const
char
*
file
,
u
int
line
,
Exception
::
Nature
nature
,
const
char
*
file
,
int
line
,
Exception
::
Nature
nature
,
const
char
*
condition
,
const
char
*
macroArgs
,
ArrayPtr
<
Array
<
char
>>
argValues
)
{
getExceptionCallback
()
->
onFatalException
(
Exception
(
nature
,
Exception
::
Durability
::
PERMANENT
,
file
,
line
,
...
...
c++/src/capnproto/logging.h
View file @
bdc568b8
...
...
@@ -48,28 +48,28 @@ public:
static
inline
void
setLogLevel
(
Severity
severity
)
{
minSeverity
=
severity
;
}
template
<
typename
...
Params
>
static
void
log
(
const
char
*
file
,
u
int
line
,
Severity
severity
,
const
char
*
macroArgs
,
static
void
log
(
const
char
*
file
,
int
line
,
Severity
severity
,
const
char
*
macroArgs
,
Params
&&
...
params
);
template
<
typename
...
Params
>
static
void
recoverableFault
(
const
char
*
file
,
u
int
line
,
Exception
::
Nature
nature
,
static
void
recoverableFault
(
const
char
*
file
,
int
line
,
Exception
::
Nature
nature
,
const
char
*
condition
,
const
char
*
macroArgs
,
Params
&&
...
params
);
template
<
typename
...
Params
>
static
void
fatalFault
(
const
char
*
file
,
u
int
line
,
Exception
::
Nature
nature
,
static
void
fatalFault
(
const
char
*
file
,
int
line
,
Exception
::
Nature
nature
,
const
char
*
condition
,
const
char
*
macroArgs
,
Params
&&
...
params
)
CAPNPROTO_NORETURN
;
private
:
static
Severity
minSeverity
;
static
void
logInternal
(
const
char
*
file
,
u
int
line
,
Severity
severity
,
const
char
*
macroArgs
,
static
void
logInternal
(
const
char
*
file
,
int
line
,
Severity
severity
,
const
char
*
macroArgs
,
ArrayPtr
<
Array
<
char
>>
argValues
);
static
void
recoverableFaultInternal
(
const
char
*
file
,
u
int
line
,
Exception
::
Nature
nature
,
const
char
*
file
,
int
line
,
Exception
::
Nature
nature
,
const
char
*
condition
,
const
char
*
macroArgs
,
ArrayPtr
<
Array
<
char
>>
argValues
);
static
void
fatalFaultInternal
(
const
char
*
file
,
u
int
line
,
Exception
::
Nature
nature
,
const
char
*
file
,
int
line
,
Exception
::
Nature
nature
,
const
char
*
condition
,
const
char
*
macroArgs
,
ArrayPtr
<
Array
<
char
>>
argValues
)
CAPNPROTO_NORETURN
;
};
...
...
@@ -113,14 +113,14 @@ ArrayPtr<const char> operator*(const Stringifier&, Log::Severity severity);
#endif
template
<
typename
...
Params
>
void
Log
::
log
(
const
char
*
file
,
u
int
line
,
Severity
severity
,
const
char
*
macroArgs
,
void
Log
::
log
(
const
char
*
file
,
int
line
,
Severity
severity
,
const
char
*
macroArgs
,
Params
&&
...
params
)
{
Array
<
char
>
argValues
[
sizeof
...(
Params
)]
=
{
str
(
params
)...};
logInternal
(
file
,
line
,
severity
,
macroArgs
,
arrayPtr
(
argValues
,
sizeof
...(
Params
)));
}
template
<
typename
...
Params
>
void
Log
::
recoverableFault
(
const
char
*
file
,
u
int
line
,
Exception
::
Nature
nature
,
void
Log
::
recoverableFault
(
const
char
*
file
,
int
line
,
Exception
::
Nature
nature
,
const
char
*
condition
,
const
char
*
macroArgs
,
Params
&&
...
params
)
{
Array
<
char
>
argValues
[
sizeof
...(
Params
)]
=
{
str
(
params
)...};
recoverableFaultInternal
(
file
,
line
,
nature
,
condition
,
macroArgs
,
...
...
@@ -128,7 +128,7 @@ void Log::recoverableFault(const char* file, uint line, Exception::Nature nature
}
template
<
typename
...
Params
>
void
Log
::
fatalFault
(
const
char
*
file
,
u
int
line
,
Exception
::
Nature
nature
,
void
Log
::
fatalFault
(
const
char
*
file
,
int
line
,
Exception
::
Nature
nature
,
const
char
*
condition
,
const
char
*
macroArgs
,
Params
&&
...
params
)
{
Array
<
char
>
argValues
[
sizeof
...(
Params
)]
=
{
str
(
params
)...};
fatalFaultInternal
(
file
,
line
,
nature
,
condition
,
macroArgs
,
...
...
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