Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
sgxwallet
Project
Project
Details
Activity
Releases
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
董子豪
sgxwallet
Commits
e3b4a5f1
Unverified
Commit
e3b4a5f1
authored
Jul 16, 2020
by
kladko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SKALE-2871-reduce-sgx-logs
parent
7fa76e24
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
40 additions
and
23 deletions
+40
-23
SGXWalletServer.cpp
SGXWalletServer.cpp
+18
-13
SGXWalletServer.h
SGXWalletServer.h
+2
-4
sgxwall.cpp
sgxwall.cpp
+15
-3
sgxwallet.h
sgxwallet.h
+2
-0
testw.cpp
testw.cpp
+3
-3
No files found.
SGXWalletServer.cpp
View file @
e3b4a5f1
...
...
@@ -29,6 +29,8 @@
#include <stdio.h>
#include "sgxwallet_common.h"
#include "sgxwallet.h"
#include "SGXException.h"
#include "LevelDB.h"
...
...
@@ -50,27 +52,30 @@
#include "Log.h"
void
setFullOptions
(
int
_printDebugInfo
,
int
_printTraceInfo
,
int
_useHTTPS
,
int
_autoconfirm
,
int
_encryptKeys
)
{
if
(
_printDebugInfo
)
spdlog
::
set_level
(
spdlog
::
level
::
debug
);
else
if
(
_printTraceInfo
)
{
using
namespace
std
;
void
setFullOptions
(
uint64_t
_logLevel
,
int
_useHTTPS
,
int
_autoconfirm
,
int
_encryptKeys
)
{
CHECK_STATE
(
_logLevel
<=
2
)
if
(
_logLevel
==
L_TRACE
)
{
spdlog
::
set_level
(
spdlog
::
level
::
trace
);
}
else
if
(
_printTraceInfo
)
{
}
else
if
(
_logLevel
==
L_DEBUG
)
{
spdlog
::
set_level
(
spdlog
::
level
::
debug
);
}
else
{
spdlog
::
set_level
(
spdlog
::
level
::
info
);
}
useHTTPS
=
_useHTTPS
;
spdlog
::
info
(
"useHTTPS set to "
+
std
::
to_string
(
_useHTTPS
));
spdlog
::
info
(
"useHTTPS set to "
+
to_string
(
_useHTTPS
));
autoconfirm
=
_autoconfirm
;
spdlog
::
info
(
"autoconfirm set to "
+
std
::
to_string
(
autoconfirm
));
spdlog
::
info
(
"autoconfirm set to "
+
to_string
(
autoconfirm
));
encryptKeys
=
_encryptKeys
;
spdlog
::
info
(
"encryptKeys set to "
+
std
::
to_string
(
encryptKeys
));
spdlog
::
info
(
"encryptKeys set to "
+
to_string
(
encryptKeys
));
}
void
setOptions
(
int
_printDebugInfo
,
int
_printTraceInfo
,
int
_useHTTPS
,
int
_autoconfirm
)
{
setFullOptions
(
_printDebugInfo
,
_printTraceInfo
,
_useHTTPS
,
_autoconfirm
,
false
);
void
setOptions
(
uint64_t
_logLevel
,
int
_useHTTPS
,
int
_autoconfirm
)
{
setFullOptions
(
_logLevel
,
_useHTTPS
,
_autoconfirm
,
false
);
}
bool
isStringDec
(
const
string
&
_str
)
{
...
...
SGXWalletServer.h
View file @
e3b4a5f1
...
...
@@ -30,11 +30,9 @@
#define EXTERNC
#endif
EXTERNC
void
setFullOptions
(
int
_printDebugInfo
,
int
_printTraceInfo
,
int
_useHTTPS
,
int
_autoconfirm
,
int
_encryptKeys
);
EXTERNC
void
setFullOptions
(
uint64_t
_logLevel
,
int
_useHTTPS
,
int
_autoconfirm
,
int
_encryptKeys
);
EXTERNC
void
setOptions
(
int
_printDebugInfo
,
int
_printTraceInfo
,
int
_useHTTPS
,
int
_autoconfirm
);
EXTERNC
void
setOptions
(
uint64_t
_logLevel
,
int
_useHTTPS
,
int
_autoconfirm
);
#endif //SGXWALLET_SGXWALLETSERVER_H
sgxwall.cpp
View file @
e3b4a5f1
...
...
@@ -56,7 +56,7 @@ void SGXWallet::printUsage() {
cerr
<<
"-T Generate test keys
\n
"
;
}
enum
log_level
{
L_TRACE
=
0
,
L_DEBUG
=
1
,
L_INFO
=
2
,
L_WARNING
=
3
,
L_ERROR
=
4
};
void
SGXWallet
::
serializeKeys
(
const
vector
<
string
>&
_ecdsaKeyNames
,
const
vector
<
string
>&
_blsKeyNames
,
const
string
&
_fileName
)
{
Json
::
Value
top
(
Json
::
objectValue
);
...
...
@@ -149,13 +149,25 @@ int main(int argc, char *argv[]) {
}
}
setFullOptions
(
printDebugInfoOption
,
printTraceInfoOption
,
useHTTPSOption
,
autoconfirmOption
,
encryptKeysOption
);
uint64_t
logLevel
=
L_INFO
;
if
(
printDebugInfoOption
)
{
logLevel
=
L_DEBUG
;
}
if
(
printTraceInfoOption
)
{
logLevel
=
L_TRACE
;
}
setFullOptions
(
logLevel
,
useHTTPSOption
,
autoconfirmOption
,
encryptKeysOption
);
uint32_t
enclaveLogLevel
=
L_INFO
;
if
(
printTraceInfoOption
)
{
enclaveLogLevel
=
L_TRACE
;
}
else
if
(
printDebugInfoOption
)
{
}
if
(
printDebugInfoOption
)
{
enclaveLogLevel
=
L_DEBUG
;
}
...
...
sgxwallet.h
View file @
e3b4a5f1
...
...
@@ -51,4 +51,6 @@ extern sgx_status_t status;
#define ENCLAVE_NAME "secure_enclave.signed.so"
enum
log_level
{
L_TRACE
=
0
,
L_DEBUG
=
1
,
L_INFO
=
2
,
L_WARNING
=
3
,
L_ERROR
=
4
};
#endif //SGXWALLET_SGXWALLET_H
testw.cpp
View file @
e3b4a5f1
...
...
@@ -70,8 +70,8 @@ class TestFixture {
public
:
TestFixture
()
{
TestUtils
::
resetDB
();
setOptions
(
false
,
false
,
false
,
true
);
initAll
(
2
,
false
,
true
);
setOptions
(
L_INFO
,
false
,
true
);
initAll
(
L_INFO
,
false
,
true
);
}
~
TestFixture
()
{
...
...
@@ -83,7 +83,7 @@ class TestFixtureHTTPS {
public
:
TestFixtureHTTPS
()
{
TestUtils
::
resetDB
();
setOptions
(
false
,
false
,
true
,
true
);
setOptions
(
L_INFO
,
true
,
true
);
initAll
(
0
,
false
,
true
);
}
...
...
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