Skip to content

Commit a3a5203

Browse files
authored
Mark AXLOG, AXLOGINFO, AXLOGWARN, AXLOGERROR deprecated (#2017)
* Mark AXLOG, AXLOGINFO, AXLOGWARN, AXLOGERROR deprecated * Fix winuwp build
1 parent 78c7e00 commit a3a5203

File tree

125 files changed

+586
-585
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

125 files changed

+586
-585
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
### Mark as deprecated
1616

1717
- `AsyncTaskPool`, use `JobSystem` instead.
18+
- `AXLOG`, `AXLOGINFO`, `AXLOGWARN`, `AXLOGERROR`, use `AXLOGD`, `AXLOGI`, `AXLOGE` instead.
1819

1920
### Bug Fixes
2021

core/2d/Action.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Action::Action() : _originalTarget(nullptr), _target(nullptr), _tag(Action::INVA
4242

4343
Action::~Action()
4444
{
45-
AXLOGINFO("deallocing Action: %p - tag: %i", this, _tag);
45+
AXLOGV("deallocing Action: {} - tag: {}", fmt::ptr(this), _tag);
4646
}
4747

4848
std::string Action::description() const
@@ -67,12 +67,12 @@ bool Action::isDone() const
6767

6868
void Action::step(float /*dt*/)
6969
{
70-
AXLOG("[Action step]. override me");
70+
AXLOGD("[Action step]. override me");
7171
}
7272

7373
void Action::update(float /*time*/)
7474
{
75-
AXLOG("[Action update]. override me");
75+
AXLOGD("[Action update]. override me");
7676
}
7777

7878
//

core/2d/ActionCatmullRom.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ PointArray* PointArray::clone() const
7979

8080
PointArray::~PointArray()
8181
{
82-
AXLOGINFO("deallocing PointArray: %p", this);
82+
AXLOGV("deallocing PointArray: {}", fmt::ptr(this));
8383
}
8484

8585
PointArray::PointArray() {}

core/2d/ActionGrid3D.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ void Waves3D::update(float time)
7474
Vec2 pos((float)i, (float)j);
7575
Vec3 v = getOriginalVertex(pos);
7676
v.z += (sinf((float)M_PI * time * _waves * 2 + (v.y + v.x) * 0.01f) * _amplitude * _amplitudeRate);
77-
// AXLOG("v.z offset is %f\n", (sinf((float)M_PI * time * _waves * 2 + (v.y+v.x) * .01f) * _amplitude *
77+
// AXLOGD("v.z offset is {}\n", (sinf((float)M_PI * time * _waves * 2 + (v.y+v.x) * .01f) * _amplitude *
7878
// _amplitudeRate));
7979
setVertex(pos, v);
8080
}

core/2d/ActionManager.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ ActionManager::ActionManager() : _currentTarget(nullptr), _currentTargetSalvaged
4242

4343
ActionManager::~ActionManager()
4444
{
45-
AXLOGINFO("deallocing ActionManager: %p", this);
45+
AXLOGV("deallocing ActionManager: {}", fmt::ptr(this));
4646

4747
removeAllActions();
4848
}

core/2d/Animation.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ bool AnimationFrame::initWithSpriteFrame(SpriteFrame* spriteFrame, float delayUn
5959

6060
AnimationFrame::~AnimationFrame()
6161
{
62-
AXLOGINFO("deallocing AnimationFrame: %p", this);
62+
AXLOGD("deallocing AnimationFrame: {}", fmt::ptr(this));
6363

6464
AX_SAFE_RELEASE(_spriteFrame);
6565
}
@@ -153,7 +153,7 @@ Animation::Animation()
153153

154154
Animation::~Animation()
155155
{
156-
AXLOGINFO("deallocing Animation: %p", this);
156+
AXLOGV("deallocing Animation: {}", fmt::ptr(this));
157157
}
158158

159159
void Animation::addSpriteFrame(SpriteFrame* spriteFrame)

core/2d/AnimationCache.cpp

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ AnimationCache::AnimationCache() {}
6161

6262
AnimationCache::~AnimationCache()
6363
{
64-
AXLOGINFO("deallocing AnimationCache: %p", this);
64+
AXLOGV("deallocing AnimationCache: {}", fmt::ptr(this));
6565
}
6666

6767
void AnimationCache::addAnimation(Animation* animation, std::string_view name)
@@ -95,10 +95,10 @@ void AnimationCache::parseVersion1(const ValueMap& animations)
9595

9696
if (frameNames.empty())
9797
{
98-
AXLOG(
99-
"axmol: AnimationCache: Animation '%s' found in dictionary without any frames - cannot add to "
98+
AXLOGW(
99+
"axmol: AnimationCache: Animation '{}' found in dictionary without any frames - cannot add to "
100100
"animation cache.",
101-
anim.first.c_str());
101+
anim.first);
102102
continue;
103103
}
104104

@@ -111,10 +111,10 @@ void AnimationCache::parseVersion1(const ValueMap& animations)
111111

112112
if (!spriteFrame)
113113
{
114-
AXLOG(
115-
"axmol:AnimationCache: Animation '%s' refers to frame '%s' which is not currently in the "
114+
AXLOGW(
115+
"axmol:AnimationCache: Animation '{}' refers to frame '{}' which is not currently in the "
116116
"SpriteFrameCache. This frame will not be added to the animation.",
117-
anim.first.c_str(), frameName.asString().c_str());
117+
anim.first, frameName.asString());
118118

119119
continue;
120120
}
@@ -125,18 +125,18 @@ void AnimationCache::parseVersion1(const ValueMap& animations)
125125

126126
if (frames.empty())
127127
{
128-
AXLOG(
129-
"axmol:AnimationCache: None of the frames for animation '%s' were found in the SpriteFrameCache. "
128+
AXLOGW(
129+
"axmol:AnimationCache: None of the frames for animation '{}' were found in the SpriteFrameCache. "
130130
"Animation is not being added to the Animation Cache.",
131-
anim.first.c_str());
131+
anim.first);
132132
continue;
133133
}
134134
else if (frames.size() != frameNameSize)
135135
{
136-
AXLOG(
136+
AXLOGW(
137137
"axmol:AnimationCache: An animation in your dictionary refers to a frame which is not in the "
138-
"SpriteFrameCache. Some or all of the frames for the animation '%s' may be missing.",
139-
anim.first.c_str());
138+
"SpriteFrameCache. Some or all of the frames for the animation '{}' may be missing.",
139+
anim.first);
140140
}
141141

142142
animation = Animation::create(frames, delay, 1);
@@ -161,10 +161,10 @@ void AnimationCache::parseVersion2(const ValueMap& animations)
161161

162162
if (frameArray.empty())
163163
{
164-
AXLOG(
165-
"axmol:AnimationCache: Animation '%s' found in dictionary without any frames - cannot add to "
164+
AXLOGW(
165+
"axmol:AnimationCache: Animation '{}' found in dictionary without any frames - cannot add to "
166166
"animation cache.",
167-
name.c_str());
167+
name);
168168
continue;
169169
}
170170

@@ -179,10 +179,10 @@ void AnimationCache::parseVersion2(const ValueMap& animations)
179179

180180
if (!spriteFrame)
181181
{
182-
AXLOG(
183-
"axmol:AnimationCache: Animation '%s' refers to frame '%s' which is not currently in the "
182+
AXLOGW(
183+
"axmol:AnimationCache: Animation '{}' refers to frame '{}' which is not currently in the "
184184
"SpriteFrameCache. This frame will not be added to the animation.",
185-
name.c_str(), spriteFrameName.c_str());
185+
name, spriteFrameName);
186186

187187
continue;
188188
}
@@ -211,7 +211,7 @@ void AnimationCache::addAnimationsWithDictionary(const ValueMap& dictionary, std
211211
auto anisItr = dictionary.find("animations");
212212
if (anisItr == dictionary.end())
213213
{
214-
AXLOG("axmol: AnimationCache: No animations were found in provided dictionary.");
214+
AXLOGW("axmol: AnimationCache: No animations were found in provided dictionary.");
215215
return;
216216
}
217217

core/2d/AutoPolygon.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ std::vector<ax::Vec2> AutoPolygon::marchSquare(const Rect& rect, const Vec2& sta
388388
}
389389
break;
390390
default:
391-
AXLOG("this shouldn't happen.");
391+
AXLOGD("this shouldn't happen.");
392392
}
393393
// little optimization
394394
// if previous direction is same as current direction,
@@ -577,7 +577,7 @@ std::vector<Vec2> AutoPolygon::expand(const std::vector<Vec2>& points, const ax:
577577
}
578578
else
579579
{
580-
AXLOG("Clipper2 detect a hole!");
580+
AXLOGW("Clipper2 detect a hole!");
581581
}
582582
}
583583

core/2d/Camera.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ Vec2 Camera::projectGL(const Vec3& src) const
307307
getViewProjectionMatrix().transformVector(Vec4(src.x, src.y, src.z, 1.0f), &clipPos);
308308

309309
if (clipPos.w == 0.0f)
310-
AXLOG("WARNING: Camera's clip position w is 0.0! a black screen should be expected.");
310+
AXLOGW("WARNING: Camera's clip position w is 0.0! a black screen should be expected.");
311311

312312
float ndcX = clipPos.x / clipPos.w;
313313
float ndcY = clipPos.y / clipPos.w;

core/2d/ClippingNode.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ void ClippingNode::onEnter()
103103
}
104104
else
105105
{
106-
AXLOG("ClippingNode warning: _stencil is nil.");
106+
AXLOGW("ClippingNode warning: _stencil is nil.");
107107
}
108108
}
109109

0 commit comments

Comments
 (0)