Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ORNL Quantum Computing Institute
xacc
Commits
b8ddb510
Commit
b8ddb510
authored
Jan 26, 2018
by
Mccaskey, Alex
Browse files
fixing bug in logging with cout
Signed-off-by:
Alex McCaskey
<
mccaskeyaj@ornl.gov
>
parent
ace478cb
Changes
7
Hide whitespace changes
Inline
Side-by-side
quantum/gate/accelerator/ReadoutErrorAcceleratorBufferPostprocessor.cpp
View file @
b8ddb510
...
...
@@ -120,9 +120,6 @@ std::map<std::string, double> ReadoutErrorAcceleratorBufferPostprocessor::fix_as
double
bp10
=
errorRates
[
kv
.
second
[
1
]].
second
;
std
::
stringstream
s2
;
s2
<<
ap01
<<
", "
<<
ap10
<<
", "
<<
bp01
<<
", "
<<
bp10
<<
"
\n
"
;
xacc
::
info
(
k0
+
", "
+
k1
+
", "
+
s2
.
str
());
newExpects
.
insert
({
kv
.
first
,
exptZZ
(
oldExpects
[
kv
.
first
],
oldExpects
[
k0
],
oldExpects
[
k1
],
ap10
,
ap01
,
bp10
,
bp01
)});
}
else
{
...
...
xacc/XACC.cpp
View file @
b8ddb510
...
...
@@ -268,6 +268,10 @@ const std::string translateWithVisitor(const std::string& originalSource, const
return
visitor
->
toString
();
}
void
clearOptions
()
{
RuntimeOptions
::
instance
()
->
clear
();
}
/**
* This method should be called by clients to
* clean up and finalize the XACC framework. It should
...
...
xacc/XACC.hpp
View file @
b8ddb510
...
...
@@ -71,6 +71,8 @@ void info(const std::string& msg, MessagePredicate predicate = std::function<boo
void
debug
(
const
std
::
string
&
msg
,
MessagePredicate
predicate
=
std
::
function
<
bool
(
void
)
>
([]()
{
return
true
;}));
void
error
(
const
std
::
string
&
msg
,
MessagePredicate
predicate
=
std
::
function
<
bool
(
void
)
>
([]()
{
return
true
;}));
void
clearOptions
();
/**
* Return true if the option exists.
*
...
...
xacc/accelerator/Accelerator.hpp
View file @
b8ddb510
...
...
@@ -197,7 +197,7 @@ public:
return
false
;
}
virtual
bool
is
Physical
()
{
virtual
bool
is
Remote
()
{
return
false
;
}
...
...
xacc/accelerator/remote/RemoteAccelerator.hpp
View file @
b8ddb510
...
...
@@ -137,6 +137,11 @@ public:
return
processResponse
(
buffer
,
responseStr
);
}
virtual
bool
isRemote
()
{
return
true
;
}
protected:
std
::
shared_ptr
<
RestClient
>
restClient
;
...
...
xacc/utils/Utils.cpp
View file @
b8ddb510
...
...
@@ -72,8 +72,8 @@ std::string base64_decode(std::string const& encoded_string) {
}
XACCLogger
::
XACCLogger
()
:
useColor
(
!
RuntimeOptions
::
instance
()
->
exists
(
"
no-color
"
))
{
useColor
(
!
RuntimeOptions
::
instance
()
->
exists
(
"no-color"
)),
useCout
(
RuntimeOptions
::
instance
()
->
exists
(
"
use-cout
"
))
{
logger
=
spdlog
::
stdout_logger_mt
(
"xacc-logger"
);
...
...
xacc/utils/Utils.hpp
View file @
b8ddb510
...
...
@@ -99,6 +99,49 @@ public:
using
MessagePredicate
=
std
::
function
<
bool
(
void
)
>
;
//class LoggerImpl {
//public:
//
// virtual void info(const std::string& msg) = 0;
// virtual void error(const std::string& msg) = 0;
//
//};
//
//class SpdlogImpl : public LoggerImpl {
//
//protected:
//
// std::shared_ptr<spdlog::logger> logger;
//
// bool useColor = true;
//
//public:
//
// SpdlogImpl() : useColor(
// !RuntimeOptions::instance()->exists("no-color")) {
// logger = spdlog::stdout_logger_mt("xacc-logger");
// }
//
// virtual void info(const std::string& msg) {
// logger->info(useColor ? "\033[1;34m" + msg + "\033[0m" : msg);
// }
//
// virtual void error(const std::string& msg) {
// logger->error(useColor ? );
// }
//};
//
//class CoutImpl : public LoggerImpl {
//
//public:
//
// virtual void info(const std::string& msg) {
// }
//
// virtual void error(const std::string& msg) {
// }
//};
class
XACCLogger
:
public
Singleton
<
XACCLogger
>
{
protected:
...
...
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