File tree Expand file tree Collapse file tree 1 file changed +6
-14
lines changed
unified-runtime/source/common/logger Expand file tree Collapse file tree 1 file changed +6
-14
lines changed Original file line number Diff line number Diff line change 2020
2121namespace logger {
2222
23- #if defined(_WIN32)
2423inline bool isTearDowned = false ;
25- #endif
2624
2725class Sink {
2826public:
@@ -45,21 +43,17 @@ class Sink {
4543
4644 std::string message = buffer.str ();
4745
48- // This is a temporary workaround on windows , where UR adapter is teardowned
46+ // This is a temporary workaround, where UR adapter is teardowned
4947// before the UR loader, which will result in access violation when we use print
5048// function as the overrided print function was already released with the UR
5149// adapter.
5250// TODO: Change adapters to use a common sink class in the loader instead of
5351// using thier own sink class that inherit from logger::Sink.
54- #if defined(_WIN32)
55- if (isTearDowned) {
56- std::cerr << message;
57- } else {
58- print (level, message);
59- }
60- #else
61- print (level, message);
62- #endif
52+ if (isTearDowned) {
53+ std::cerr << message;
54+ } else {
55+ print (level, message);
56+ }
6357 }
6458
6559 void setFileLine (bool fileline) { add_fileline = fileline; }
@@ -194,9 +188,7 @@ class StderrSink : public Sink {
194188 }
195189
196190 ~StderrSink () {
197- #if defined(_WIN32)
198191 logger::isTearDowned = true ;
199- #endif
200192 }
201193};
202194
You can’t perform that action at this time.
0 commit comments