Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mark AXLOG, AXLOGINFO, AXLOGWARN, AXLOGERROR deprecated #2017

Merged
merged 2 commits into from
Jul 4, 2024

Conversation

halx99
Copy link
Collaborator

@halx99 halx99 commented Jul 4, 2024

Describe your changes

Remove all old log macro calls from core folder, instead use c++20 format style macros: AXLOGD, AXLOGI, AXLOGW, AXLOGE.

Issue ticket number and link

Checklist before requesting a review

For each PR

  • Add Copyright if it missed:
    - "Copyright (c) 2019-present Axmol Engine contributors (see AUTHORS.md)."

  • I have performed a self-review of my code.

    Optional:

    • I have checked readme and add important infos to this PR.
    • I have added/adapted some tests too.

For core/new feature PR

  • I have checked readme and add important infos to this PR.
  • I have added thorough tests.

@halx99 halx99 added this to the 2.1.4 milestone Jul 4, 2024
@halx99 halx99 force-pushed the mark-old-log-macros-deprecated branch from c3ede55 to 2f812af Compare July 4, 2024 17:15
@halx99 halx99 added the enhancement New feature or request label Jul 4, 2024
@johnspeny
Copy link

I have mostly used AXLOG, so I should shift to ax::print I guess.

@halx99
Copy link
Collaborator Author

halx99 commented Jul 4, 2024

ax::print also deprecated, you can still use them until axmol 2.2.x

@johnspeny
Copy link

What do we use now?.

@paulocoutinhox
Copy link
Contributor

@johnspeny you need use AXLOGD, AXLOGW, AXLOGE, etc.

@johnspeny
Copy link

Didn't know they existed, nice work.

@halx99 halx99 merged commit a3a5203 into dev Jul 4, 2024
15 checks passed
@halx99 halx99 deleted the mark-old-log-macros-deprecated branch July 4, 2024 23:55
@rh101
Copy link
Contributor

rh101 commented Jul 5, 2024

@halx99 This change has resulted in a lot of log spam, such as the following:

16:34:49:968	I/[2024-07-05 16:34:49.737][TID:795c]x = 1643 y = 990
16:34:49:968	I/[2024-07-05 16:34:49.861][TID:795c]Ending touches with id: 0, x=1643, y=990
16:34:49:968	D/[2024-07-05 16:34:49.920][TID:795c]deallocing AnimationFrame: 0x274723b2980
16:34:49:968	D/[2024-07-05 16:34:49.920][TID:795c]deallocing AnimationFrame: 0x274723b38f0
16:34:49:968	D/[2024-07-05 16:34:49.920][TID:795c]deallocing AnimationFrame: 0x274723b2a50
16:34:49:968	D/[2024-07-05 16:34:49.921][TID:795c]deallocing AnimationFrame: 0x274723b2b20
16:34:49:968	D/[2024-07-05 16:34:49.921][TID:795c]deallocing AnimationFrame: 0x274723b5630
16:34:49:968	D/[2024-07-05 16:34:49.921][TID:795c]deallocing AnimationFrame: 0x274723b5700
16:34:49:968	D/[2024-07-05 16:34:49.922][TID:795c]deallocing AnimationFrame: 0x274723b42b0
16:34:49:968	D/[2024-07-05 16:34:49.923][TID:795c]deallocing AnimationFrame: 0x274723b6740
16:34:49:968	D/[2024-07-05 16:34:49.923][TID:795c]deallocing AnimationFrame: 0x274723b5970
16:34:49:968	D/[2024-07-05 16:34:49.923][TID:795c]deallocing AnimationFrame: 0x274723b0350
16:34:49:968	D/[2024-07-05 16:34:49.924][TID:795c]deallocing AnimationFrame: 0x274723af170
16:34:49:968	D/[2024-07-05 16:34:49.924][TID:795c]deallocing AnimationFrame: 0x274723b09d0
16:34:49:968	D/[2024-07-05 16:34:49.924][TID:795c]deallocing AnimationFrame: 0x274723af240
16:34:49:968	D/[2024-07-05 16:34:49.925][TID:795c]deallocing AnimationFrame: 0x274723b1050
16:34:49:968	D/[2024-07-05 16:34:49.925][TID:795c]deallocing AnimationFrame: 0x274723af310
16:34:49:968	D/[2024-07-05 16:34:49.925][TID:795c]deallocing AnimationFrame: 0x274723af3e0
16:34:49:968	D/[2024-07-05 16:34:49.925][TID:795c]deallocing AnimationFrame: 0x274723b1bb0
16:34:49:968	D/[2024-07-05 16:34:49.925][TID:795c]deallocing AnimationFrame: 0x274723b1460
16:34:49:968	D/[2024-07-05 16:34:49.926][TID:795c]deallocing AnimationFrame: 0x274723afcd0
16:34:49:968	D/[2024-07-05 16:34:49.945][TID:795c]deallocing AnimationFrame: 0x2746ee97720
16:34:49:968	D/[2024-07-05 16:34:49.945][TID:795c]deallocing AnimationFrame: 0x2746ee96540
16:34:49:968	D/[2024-07-05 16:34:49.945][TID:795c]deallocing AnimationFrame: 0x2746ee981b0

Can we please have these use AXLOGV instead of AXLOGD/AXLOGI?

AnimationFrame::~AnimationFrame()
{
    AXLOGD("deallocing AnimationFrame: {}", fmt::ptr(this));

    AX_SAFE_RELEASE(_spriteFrame);
}

AXLOGI("Ending touches with id: {}, x={}, y={}", (int)id, x, y);

AXLOGI("Moving touches with id: {}, x={}, y={}, force={}, maxFource={}", (int)id, x, y, force, maxForce);

AXLOGI("x = {} y = {}", touch->getLocationInView().x, touch->getLocationInView().y);

Is the AnimationFrame::~AnimationFrame() log call even useful at all?

@halx99
Copy link
Collaborator Author

halx99 commented Jul 5, 2024

Yes, should use AXLOGV instead

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants