Skip to content

Commit 28013e9

Browse files
authored
Replace all ax::print with AXLOGD,AXLOGI (#2032)
1 parent 11b8d28 commit 28013e9

File tree

38 files changed

+268
-268
lines changed

38 files changed

+268
-268
lines changed

tests/cpp-tests/Source/ActionManagerTest/ActionManagerTest.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -361,8 +361,8 @@ std::string StopActionsByFlagsTest::subtitle() const
361361
class SpriteIssue14050 : public Sprite
362362
{
363363
public:
364-
SpriteIssue14050() { ax::print("SpriteIssue14050::constructor"); }
365-
virtual ~SpriteIssue14050() { ax::print("SpriteIssue14050::destructor"); }
364+
SpriteIssue14050() { AXLOGD("SpriteIssue14050::constructor"); }
365+
virtual ~SpriteIssue14050() { AXLOGD("SpriteIssue14050::destructor"); }
366366
};
367367

368368
void Issue14050Test::onEnter()

tests/cpp-tests/Source/ActionsTest/ActionsTest.cpp

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -673,7 +673,7 @@ void ActionAnimate::onEnter()
673673
_frameDisplayedListener = EventListenerCustom::create(AnimationFrameDisplayedNotification, [](EventCustom* event) {
674674
auto userData = static_cast<AnimationFrame::DisplayedEventInfo*>(event->getUserData());
675675

676-
ax::print("target %p with data %s", userData->target, Value(userData->userInfo).getDescription().c_str());
676+
AXLOGD("target {} with data {}", fmt::ptr(userData->target), Value(userData->userInfo).getDescription());
677677
});
678678

679679
_eventDispatcher->addEventListenerWithFixedPriority(_frameDisplayedListener, -1);
@@ -1664,7 +1664,7 @@ void Issue1305::onEnter()
16641664

16651665
void Issue1305::print(Node* sender)
16661666
{
1667-
ax::print("This message SHALL ONLY appear when the sprite is added to the scene, NOT BEFORE");
1667+
AXLOGI("This message SHALL ONLY appear when the sprite is added to the scene, NOT BEFORE");
16681668
}
16691669

16701670
void Issue1305::onExit()
@@ -1728,22 +1728,22 @@ void Issue1305_2::onEnter()
17281728

17291729
void Issue1305_2::printLog1()
17301730
{
1731-
ax::print("1st block");
1731+
AXLOGD("1st block");
17321732
}
17331733

17341734
void Issue1305_2::printLog2()
17351735
{
1736-
ax::print("2nd block");
1736+
AXLOGD("2nd block");
17371737
}
17381738

17391739
void Issue1305_2::printLog3()
17401740
{
1741-
ax::print("3rd block");
1741+
AXLOGD("3rd block");
17421742
}
17431743

17441744
void Issue1305_2::printLog4()
17451745
{
1746-
ax::print("4th block");
1746+
AXLOGD("4th block");
17471747
}
17481748

17491749
std::string Issue1305_2::title() const
@@ -1841,14 +1841,14 @@ std::string Issue1327::subtitle() const
18411841

18421842
void Issue1327::logSprRotation(Sprite* sender)
18431843
{
1844-
ax::print("%f", sender->getRotation());
1844+
AXLOGD("{}", sender->getRotation());
18451845
}
18461846

18471847
// Issue1398
18481848
void Issue1398::incrementInteger()
18491849
{
18501850
_testInteger++;
1851-
ax::print("incremented to %d", _testInteger);
1851+
AXLOGD("incremented to {}", _testInteger);
18521852
}
18531853

18541854
void Issue1398::onEnter()
@@ -1857,7 +1857,7 @@ void Issue1398::onEnter()
18571857
this->centerSprites(0);
18581858

18591859
_testInteger = 0;
1860-
ax::print("testInt = %d", _testInteger);
1860+
AXLOGD("testInt = {}", _testInteger);
18611861

18621862
this->runAction(
18631863
Sequence::create(CallFunc::create(std::bind(&Issue1398::incrementIntegerCallback, this, (void*)"1")),
@@ -1873,7 +1873,7 @@ void Issue1398::onEnter()
18731873
void Issue1398::incrementIntegerCallback(void* data)
18741874
{
18751875
this->incrementInteger();
1876-
ax::print("%s", (char*)data);
1876+
AXLOGD("{}", (char*)data);
18771877
}
18781878

18791879
std::string Issue1398::subtitle() const
@@ -1892,14 +1892,14 @@ void Issue2599::onEnter()
18921892
this->centerSprites(0);
18931893

18941894
_count = 0;
1895-
ax::print("before: count = %d", _count);
1895+
AXLOGD("before: count = {}", _count);
18961896

1897-
ax::print("start count up 50 times using Repeat action");
1897+
AXLOGD("start count up 50 times using Repeat action");
18981898
auto delay = 1.0f / 50;
18991899
auto repeatAction = Repeat::create(
19001900
Sequence::createWithTwoActions(CallFunc::create([&]() { this->_count++; }), DelayTime::create(delay)), 50);
19011901
this->runAction(Sequence::createWithTwoActions(
1902-
repeatAction, CallFunc::create([&]() { ax::print("after: count = %d", this->_count); })));
1902+
repeatAction, CallFunc::create([&]() { AXLOGD("after: count = {}", this->_count); })));
19031903
}
19041904

19051905
std::string Issue2599::subtitle() const
@@ -2080,7 +2080,7 @@ void PauseResumeActions::onEnter()
20802080

20812081
this->schedule(
20822082
[&](float dt) {
2083-
ax::print("Pausing");
2083+
AXLOGD("Pausing");
20842084
auto director = Director::getInstance();
20852085

20862086
_pausedTargets = director->getActionManager()->pauseAllRunningActions();
@@ -2089,7 +2089,7 @@ void PauseResumeActions::onEnter()
20892089

20902090
this->schedule(
20912091
[&](float dt) {
2092-
ax::print("Resuming");
2092+
AXLOGD("Resuming");
20932093
auto director = Director::getInstance();
20942094
director->getActionManager()->resumeTargets(_pausedTargets);
20952095
_pausedTargets.clear();
@@ -2313,7 +2313,7 @@ void SequenceWithFinalInstant::onEnter()
23132313

23142314
bool called(false);
23152315
const auto f([&called]() -> void {
2316-
ax::print("Callback called.");
2316+
AXLOGD("Callback called.");
23172317
called = true;
23182318
});
23192319

tests/cpp-tests/Source/BugsTest/Bug-1174.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ int check_for_error(Vec2 p1, Vec2 p2, Vec2 p3, Vec2 p4, float s, float t)
4949
// Since float has rounding errors, only check if diff is < 0.05
5050
if ((fabs(hitPoint1.x - hitPoint2.x) > 0.1f) || (fabs(hitPoint1.y - hitPoint2.y) > 0.1f))
5151
{
52-
ax::print("ERROR: (%f,%f) != (%f,%f)", hitPoint1.x, hitPoint1.y, hitPoint2.x, hitPoint2.y);
52+
AXLOGE("ERROR: ({},{}) != ({},{})", hitPoint1.x, hitPoint1.y, hitPoint2.x, hitPoint2.y);
5353
return 1;
5454
}
5555

@@ -72,7 +72,7 @@ bool Bug1174Layer::init()
7272
//
7373
// Test 1.
7474
//
75-
ax::print("Test1 - Start");
75+
AXLOGD("Test1 - Start");
7676
for (int i = 0; i < 10000; i++)
7777
{
7878
// A | b
@@ -111,12 +111,12 @@ bool Bug1174Layer::init()
111111
ok++;
112112
}
113113
}
114-
ax::print("Test1 - End. OK=%i, Err=%i", ok, err);
114+
AXLOGI("Test1 - End. OK={}, Err={}", ok, err);
115115

116116
//
117117
// Test 2.
118118
//
119-
ax::print("Test2 - Start");
119+
AXLOGI("Test2 - Start");
120120

121121
p1 = Vec2(220, 480);
122122
p2 = Vec2(304, 325);
@@ -127,12 +127,12 @@ bool Bug1174Layer::init()
127127
if (Vec2::isLineIntersect(p1, p2, p3, p4, &s, &t))
128128
check_for_error(p1, p2, p3, p4, s, t);
129129

130-
ax::print("Test2 - End");
130+
AXLOGI("Test2 - End");
131131

132132
//
133133
// Test 3
134134
//
135-
ax::print("Test3 - Start");
135+
AXLOGI("Test3 - Start");
136136

137137
ok = 0;
138138
err = 0;
@@ -179,7 +179,7 @@ bool Bug1174Layer::init()
179179
}
180180
}
181181

182-
ax::print("Test3 - End. OK=%i, err=%i", ok, err);
182+
AXLOGI("Test3 - End. OK={}, err={}", ok, err);
183183
return true;
184184
}
185185

tests/cpp-tests/Source/BugsTest/Bug-14327.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,23 +94,23 @@ void Bug14327Layer::update(float dt)
9494

9595
void Bug14327Layer::editBoxEditingDidBegin(ax::ui::EditBox* editBox)
9696
{
97-
ax::print("editBox %p DidBegin !", editBox);
97+
AXLOGD("editBox {} DidBegin !", fmt::ptr(editBox));
9898
}
9999

100100
void Bug14327Layer::editBoxEditingDidEndWithAction(ax::ui::EditBox* editBox,
101101
ax::ui::EditBoxDelegate::EditBoxEndAction EditBoxEndAction)
102102
{
103-
ax::print("editBox %p DidEnd !", editBox);
103+
AXLOGD("editBox {} DidEnd !", fmt::ptr(editBox));
104104
}
105105

106106
void Bug14327Layer::editBoxTextChanged(ax::ui::EditBox* editBox, std::string_view text)
107107
{
108-
ax::print("editBox %p TextChanged, text: %s ", editBox, text.data());
108+
AXLOGD("editBox {} TextChanged, text: {} ", fmt::ptr(editBox), text);
109109
}
110110

111111
void Bug14327Layer::editBoxReturn(ui::EditBox* editBox)
112112
{
113-
ax::print("editBox %p was returned !", editBox);
113+
AXLOGD("editBox {} was returned !", fmt::ptr(editBox));
114114
}
115115

116116
#endif

tests/cpp-tests/Source/BugsTest/Bug-422.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,12 @@ void Bug422Layer::reset()
5353
// and then a new node will be allocated occupying the memory.
5454
// => CRASH BOOM BANG
5555
auto node = getChildByTag(localtag - 1);
56-
ax::print("Menu: %p", node);
56+
AXLOGD("Menu: {}", fmt::ptr(node));
5757
removeChild(node, true);
5858
// [self removeChildByTag:localtag-1 cleanup:NO];
5959

6060
auto item1 = MenuItemFont::create("One", AX_CALLBACK_1(Bug422Layer::menuCallback, this));
61-
ax::print("MenuItemFont: %p", item1);
61+
AXLOGD("MenuItemFont: {}", fmt::ptr(item1));
6262
MenuItem* item2 = MenuItemFont::create("Two", AX_CALLBACK_1(Bug422Layer::menuCallback, this));
6363
auto menu = Menu::create(item1, item2, nullptr);
6464
menu->alignItemsVertically();
@@ -76,7 +76,7 @@ void Bug422Layer::check(Node* t)
7676
auto& children = t->getChildren();
7777
for (const auto& child : children)
7878
{
79-
ax::print("%p, rc: %d", child, child->getReferenceCount());
79+
AXLOGD("{}, rc: {}", fmt::ptr(child), child->getReferenceCount());
8080
check(child);
8181
}
8282
}

tests/cpp-tests/Source/BugsTest/Bug-458/Bug-458.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,5 +68,5 @@ bool Bug458Layer::init()
6868

6969
void Bug458Layer::selectAnswer(Object* sender)
7070
{
71-
ax::print("Selected");
71+
AXLOGD("Selected");
7272
}

tests/cpp-tests/Source/BugsTest/Bug-458/QuestionContainerSprite.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ bool QuestionContainerSprite::init()
5454
label->setColor(Color3B::BLUE);
5555
else
5656
{
57-
ax::print("Color changed");
57+
AXLOGD("Color changed");
5858
label->setColor(Color3B::RED);
5959
}
6060
a++;

tests/cpp-tests/Source/BugsTest/Bug-624.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ void Bug624Layer::switchLayer(float dt)
7474

7575
void Bug624Layer::onAcceleration(Acceleration* acc, Event* event)
7676
{
77-
ax::print("Layer1 accel");
77+
AXLOGD("Layer1 accel");
7878
}
7979

8080
////////////////////////////////////////////////////////
@@ -120,5 +120,5 @@ void Bug624Layer2::switchLayer(float dt)
120120

121121
void Bug624Layer2::onAcceleration(Acceleration* acc, Event* event)
122122
{
123-
ax::print("Layer2 accel");
123+
AXLOGD("Layer2 accel");
124124
}

tests/cpp-tests/Source/BugsTest/Bug-914.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ bool Bug914Layer::init()
7373

7474
void Bug914Layer::onTouchesMoved(const std::vector<Touch*>& touches, Event* event)
7575
{
76-
ax::print("Number of touches: %d", (int)touches.size());
76+
AXLOGD("Number of touches: {}", (int)touches.size());
7777
}
7878

7979
void Bug914Layer::onTouchesBegan(const std::vector<Touch*>& touches, Event* event)

tests/cpp-tests/Source/ConfigurationTest/ConfigurationTest.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ void ConfigurationLoadConfig::onEnter()
5353

5454
Configuration::getInstance()->loadConfigFile("configs/config-test-ok.plist");
5555
std::string config = Configuration::getInstance()->getInfo();
56-
ax::print("%s\n", config.c_str());
56+
AXLOGD("{}\n", config);
5757
}
5858

5959
std::string ConfigurationLoadConfig::subtitle() const
@@ -70,8 +70,8 @@ void ConfigurationQuery::onEnter()
7070
{
7171
ConfigurationBase::onEnter();
7272

73-
ax::print("cocos2d version: %s", Configuration::getInstance()->getValue("axmol.version").asString().c_str());
74-
ax::print("OpenGL version: %s", Configuration::getInstance()->getValue("gl.version").asString().c_str());
73+
AXLOGD("axmol version: %s", Configuration::getInstance()->getValue("axmol.version").asString());
74+
AXLOGD("OpenGL version: %s", Configuration::getInstance()->getValue("gl.version").asString());
7575
}
7676

7777
std::string ConfigurationQuery::subtitle() const
@@ -107,21 +107,21 @@ void ConfigurationDefault::onEnter()
107107

108108
std::string c_value = Configuration::getInstance()->getValue("invalid.key", Value("no key")).asString();
109109
if (c_value != "no key")
110-
ax::print("1. Test failed!");
110+
AXLOGD("1. Test failed!");
111111
else
112-
ax::print("1. Test OK!");
112+
AXLOGD("1. Test OK!");
113113

114114
bool b_value = Configuration::getInstance()->getValue("invalid.key", Value(true)).asBool();
115115
if (!b_value)
116-
ax::print("2. Test failed!");
116+
AXLOGD("2. Test failed!");
117117
else
118-
ax::print("2. Test OK!");
118+
AXLOGD("2. Test OK!");
119119

120120
double d_value = Configuration::getInstance()->getValue("invalid.key", Value(42.42)).asDouble();
121121
if (d_value != 42.42)
122-
ax::print("3. Test failed!");
122+
AXLOGD("3. Test failed!");
123123
else
124-
ax::print("3. Test OK!");
124+
AXLOGD("3. Test OK!");
125125
}
126126

127127
std::string ConfigurationDefault::subtitle() const
@@ -145,7 +145,7 @@ void ConfigurationSet::onEnter()
145145
conf->setValue("this.is.a.string.value", Value("hello world"));
146146

147147
auto str = conf->getInfo();
148-
ax::print("%s\n", str.c_str());
148+
AXLOGD("{}\n", str);
149149
}
150150

151151
std::string ConfigurationSet::subtitle() const

0 commit comments

Comments
 (0)