nix-community / disko

Declarative disk partitioning and formatting using nix [maintainers=@Lassulus @Enzime @iFreilicht]
MIT License
1.88k stars 199 forks source link

New log format. #867

Open Sk7Str1p3 opened 2 weeks ago

Sk7Str1p3 commented 2 weeks ago

Format of logs rn:

+ blkid /dev/mapper/crypted -o export
+ grep -q '^TYPE='
+ mkfs.btrfs /dev/mapper/crypted -f 
+ rm -rf /tmp/tmp.tsScPEKz1v
+ device=/dev/vdb
+ imageName=main
+ imageSize=2G 
+ name=main
+ type=disk
+ device=/dev/vdb
+ efiGptPartitionFirst=1
+ type=gpt

Is unreadable and ugly asf. It looks not like log but bash script. I wish it could be like nixos-rebuild log or rather home-manager or best of both implementations.

Sk7Str1p3 commented 2 weeks ago

Just give me file generating logs and I'll send you PR in a week

iFreilicht commented 2 weeks ago

It looks not like log but bash script.

That's because it is. These logs are generated by set -x.

So you'd have to write separate logging statements for every shell invocation, which would make the logs look nicer but the shell script twice as long and way less readable.

Better logging is being implemented in #789

Sk7Str1p3 commented 6 days ago

@iFreilicht I made few progress with my project, cli part is ready, few more days and current Disko version (with current features I mean) will be ready to be merged. If you wish me continue, create separate branch for this and I'll make a PR asap. Thx

iFreilicht commented 5 days ago

Sure, I'd be glad to take a look at it!

Sk7Str1p3 commented 3 days ago

The only reason I will not fork project and help with writing this with python is because my project is obviously doomed to oblivion, no one will not even know about it. Even if I manage to make a nixpkg everyone will still use your version. I hope you understand that too and don't think I can talk only. Wait my first commit next week.

Mic92 commented 2 days ago

Makes sense. You don't need to prove anything to us. We know it's technically possible to write it it in C++, we just prefer not to.

Sk7Str1p3 commented 2 days ago

the one of the reasons why i did not want to use python. i simply cloned repo, installed python313Full with home-manager (if it matters) and got this error: image

iFreilicht commented 2 days ago

You can run nix develop, I locked a python version with all required tools installed.