2 * Copyright (c) 2020 Samsung Electronics Co., Ltd. All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #include "ProgressReporter.h"
20 #include "luci/LogHelper.h"
22 #include <logo/Phase.h>
23 #include <logo/Pass.h>
30 char to_char(bool b) { return b ? 'Y' : 'N'; }
32 const char *to_str(logo::PhaseStrategy s)
36 case logo::PhaseStrategy::Saturate:
38 case logo::PhaseStrategy::Restart:
50 void ProgressReporter::notify(const logo::PhaseEventInfo<logo::PhaseEvent::PhaseBegin> *)
54 VERBOSE(l, 4) << "==============================================================";
55 VERBOSE(l, 4) << "luci::PhaseRunner<" << to_str(strategy()) << ">";
56 VERBOSE(l, 4) << "Initial graph";
57 VERBOSE(l, 4) << fmt(graph());
60 void ProgressReporter::notify(const logo::PhaseEventInfo<logo::PhaseEvent::PhaseEnd> *)
64 VERBOSE(l, 4) << "luci::PhaseRunner<" << to_str(strategy()) << "> - done";
67 void ProgressReporter::notify(const logo::PhaseEventInfo<logo::PhaseEvent::PassBegin> *info)
71 VERBOSE(l, 4) << "--------------------------------------------------------------";
72 VERBOSE(l, 4) << "Before " << logo::pass_name(info->pass());
75 void ProgressReporter::notify(const logo::PhaseEventInfo<logo::PhaseEvent::PassEnd> *info)
79 VERBOSE(l, 4) << "After " << logo::pass_name(info->pass())
80 << " (changed: " << to_char(info->changed()) << ")";
81 VERBOSE(l, 4) << fmt(graph());