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

ctrtool silence/quiet option #113

Closed
vulcandth opened this issue Mar 28, 2022 · 12 comments
Closed

ctrtool silence/quiet option #113

vulcandth opened this issue Mar 28, 2022 · 12 comments

Comments

@vulcandth
Copy link

vulcandth commented Mar 28, 2022

Would it be possible to support a silence or quiet option to suppress output? It would be useful for including in other scripts/tools.

If it requires too much work; I'll just try outputting to /dev/null instead.

@jakcron
Copy link
Collaborator

jakcron commented Mar 29, 2022

I don't see why not.

Would you prefer to suppress all output, including errors?

@vulcandth
Copy link
Author

For my purposes; just the standard output. I'm okay with receiving errors.

@jakcron
Copy link
Collaborator

jakcron commented Mar 29, 2022

I will comment back here with the pull request, so you can review the behaviour. Give it a week though haha.

@vulcandth
Copy link
Author

No problem! Take as much time as you need. No rush on it.

@jakcron
Copy link
Collaborator

jakcron commented Apr 12, 2022

@vulcandth

I've made a pull request to add a silent mode to CTRTool.

Please review the pull request ( #118 ) and these binaries to see if the output suites your request:
ctrtool-macos_arm64.zip
ctrtool-macos_x86_64.zip
ctrtool-ubuntu_x86_64.zip
ctrtool-win_x64.zip
ctrtool-win_x86.zip

If you're satisfied i'll merge it and make a proper release.

@vulcandth
Copy link
Author

Sounds great! I should hopefully have the time to test this tonight. I'll reply back as soon as I am done testing.

@vulcandth
Copy link
Author

vulcandth commented Apr 14, 2022

It is definitely a lot less noisy now... However There some information output that I still feel like should be getting suppressed.. See below:

ctrtool --cidx 0 \
           --seeddb=seeddb.bin \
           --exheader=polishedcrystal-faithful-noir-3.0.0-beta/exheader.bin \
           --exefsdir=polishedcrystal-faithful-noir-3.0.0-beta/exefs \
           --romfsdir=polishedcrystal-faithful-noir-3.0.0-beta/romfs \
           --logo=polishedcrystal-faithful-noir-3.0.0-beta/logo.lz \
           --plainrgn=polishedcrystal-faithful-noir-3.0.0-beta/plain.bin \
                   -q \
           polishedcrystal-faithful-noir-3.0.0-beta.orig.cia
Saving Extended Header...
Saving Plain Region...
Saving Logo...
[ctrtool::ExeFsProcess LOG] Decompressing file /.code to polishedcrystal-faithful-noir-3.0.0-beta/exefs/code.bin...
[ctrtool::ExeFsProcess LOG] Saving file /banner to polishedcrystal-faithful-noir-3.0.0-beta/exefs/banner.bin...
[ctrtool::ExeFsProcess LOG] Saving file /icon to polishedcrystal-faithful-noir-3.0.0-beta/exefs/icon.bin...
[ctrtool::RomFsProcess LOG] Saving polishedcrystal-faithful-noir-3.0.0-beta/romfs/agb.bin...
[ctrtool::RomFsProcess LOG] Saving polishedcrystal-faithful-noir-3.0.0-beta/romfs/buildtime.txt...
[ctrtool::RomFsProcess LOG] Saving polishedcrystal-faithful-noir-3.0.0-beta/romfs/CGBAAUK0.959.patch...
[ctrtool::RomFsProcess LOG] Saving polishedcrystal-faithful-noir-3.0.0-beta/romfs/CGBAAXK0.960.patch...
[ctrtool::RomFsProcess LOG] Saving polishedcrystal-faithful-noir-3.0.0-beta/romfs/CGBBXTJ0.534.patch...
[ctrtool::RomFsProcess LOG] Saving polishedcrystal-faithful-noir-3.0.0-beta/romfs/CGBBYTD0.837.patch...
[ctrtool::RomFsProcess LOG] Saving polishedcrystal-faithful-noir-3.0.0-beta/romfs/CGBBYTE1.784.patch...
[ctrtool::RomFsProcess LOG] Saving polishedcrystal-faithful-noir-3.0.0-beta/romfs/CGBBYTF0.849.patch...
[ctrtool::RomFsProcess LOG] Saving polishedcrystal-faithful-noir-3.0.0-beta/romfs/CGBBYTI0.878.patch...
[ctrtool::RomFsProcess LOG] Saving polishedcrystal-faithful-noir-3.0.0-beta/romfs/CGBBYTS0.860.patch...
[ctrtool::RomFsProcess LOG] Saving polishedcrystal-faithful-noir-3.0.0-beta/romfs/config.ini...
[ctrtool::RomFsProcess LOG] Saving polishedcrystal-faithful-noir-3.0.0-beta/romfs/DMGAAUD0.K00.patch...
[ctrtool::RomFsProcess LOG] Saving polishedcrystal-faithful-noir-3.0.0-beta/romfs/DMGAAUF0.J95.patch...
[ctrtool::RomFsProcess LOG] Saving polishedcrystal-faithful-noir-3.0.0-beta/romfs/DMGAAUI0.K07.patch...
[ctrtool::RomFsProcess LOG] Saving polishedcrystal-faithful-noir-3.0.0-beta/romfs/DMGAAUJ1.H98.patch...
[ctrtool::RomFsProcess LOG] Saving polishedcrystal-faithful-noir-3.0.0-beta/romfs/DMGAAUP0.J56.patch...
[ctrtool::RomFsProcess LOG] Saving polishedcrystal-faithful-noir-3.0.0-beta/romfs/DMGAAUS0.K09.patch...
[ctrtool::RomFsProcess LOG] Saving polishedcrystal-faithful-noir-3.0.0-beta/romfs/DMGAAXD0.K01.patch...
[ctrtool::RomFsProcess LOG] Saving polishedcrystal-faithful-noir-3.0.0-beta/romfs/DMGAAXF0.J96.patch...
[ctrtool::RomFsProcess LOG] Saving polishedcrystal-faithful-noir-3.0.0-beta/romfs/DMGAAXI0.K08.patch...
[ctrtool::RomFsProcess LOG] Saving polishedcrystal-faithful-noir-3.0.0-beta/romfs/DMGAAXJ1.H99.patch...
[ctrtool::RomFsProcess LOG] Saving polishedcrystal-faithful-noir-3.0.0-beta/romfs/DMGAAXP0.J57.patch...
[ctrtool::RomFsProcess LOG] Saving polishedcrystal-faithful-noir-3.0.0-beta/romfs/DMGAAXS0.K10.patch...
[ctrtool::RomFsProcess LOG] Saving polishedcrystal-faithful-noir-3.0.0-beta/romfs/ErrLayout.arc...
[ctrtool::RomFsProcess LOG] Saving polishedcrystal-faithful-noir-3.0.0-beta/romfs/face_cgb.ttp...
[ctrtool::RomFsProcess LOG] Saving polishedcrystal-faithful-noir-3.0.0-beta/romfs/layout.arc...
[ctrtool::RomFsProcess LOG] Saving polishedcrystal-faithful-noir-3.0.0-beta/romfs/shader.shbin...

I truncated most of it.

I will say it is definitely to a much more manageable amount of noise.. Just curious if this output was intended.

(Tested on Windows Subsystem for Linux - Ubuntu)

@jakcron
Copy link
Collaborator

jakcron commented Apr 14, 2022

Thank you for your feedback :)

I was undecided on whether Saving X... messages should be silenced. But considering how many files can be in a RomFs, it's probably best to hide it behind verbose output mode (at least when in silenced mode).

@jakcron
Copy link
Collaborator

jakcron commented Apr 14, 2022

I'll make another change and report back here.

@jakcron
Copy link
Collaborator

jakcron commented Apr 15, 2022

@vulcandth so I've hidden Saving X... style output, it'll only show if you enable verbose mode (-v/--verbose).

So in theory the command below should be completely silent unless something actually goes wrong and it can't extract (e.g. decryption failed):

ctrtool --cidx 0 \
           --seeddb=seeddb.bin \
           --exheader=polishedcrystal-faithful-noir-3.0.0-beta/exheader.bin \
           --exefsdir=polishedcrystal-faithful-noir-3.0.0-beta/exefs \
           --romfsdir=polishedcrystal-faithful-noir-3.0.0-beta/romfs \
           --logo=polishedcrystal-faithful-noir-3.0.0-beta/logo.lz \
           --plainrgn=polishedcrystal-faithful-noir-3.0.0-beta/plain.bin \
                   -q \
           polishedcrystal-faithful-noir-3.0.0-beta.orig.cia

Here are some builds to test with:

@vulcandth
Copy link
Author

Just tried it! it works great thank you! I'm going to close this.

@jakcron
Copy link
Collaborator

jakcron commented Apr 15, 2022

@vulcandth This functionality has been formally released in CTRTool v1.1.0 which is available from the release page.

https://github.com/3DSGuy/Project_CTR/releases/tag/ctrtool-v1.1.0

I'm glad I was able to help you with this one. Thank you for your speedy feedback.

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

No branches or pull requests

2 participants