larsiusprime / crashdumper

A cross-platform automated crash report generator/sender for Haxe/OpenFL apps.
MIT License
113 stars 33 forks source link

Make cpp mac target log some system stats #12

Closed leolannenmaki closed 10 years ago

leolannenmaki commented 10 years ago

Based on discussion in https://github.com/larsiusprime/crashdumper/issues/10

Currently uses command system_profiler SPHardwareDataType -detailLevel mini something like four times, which might be a bit excessive. The call count can be reduced by combining os.sh, memory.sh and cpu.sh and then parsing the combined output a bit differently in SystemData.hx. Didn't do it, as I just wanted it something to log something, quick :)

Script output:

$ ./os.sh
OS X 10.9.2 (13C1021) iMac iMac12,2
$ ./cpu.sh
Intel Core i7 3,40 GHz
$ ./gpu.sh
Gainward GeForce GTX 570 1280 MB 1680 x 1050 @ 60 Hz
$ ./memory.sh
16 GB

Log output:

SystemData
{
  OS : OS X 10.9.2 (13C1021) iMac iMac12,2
  RAM: 16 GB
  CPU: Intel Core i7 3,40 GHz
  GPU: Gainward GeForce GTX 570 1280 MB 1680 x 1050 @ 60 Hz
, driver v. unknown
}
....the rest is omitted
larsiusprime commented 10 years ago

Nicely done! Left a comment inline, I'll merge this as soon as I have confirmation from one other mac user that this works.