James Kuszmaul | 011b67a | 2019-12-15 12:52:34 -0800 | [diff] [blame] | 1 | #ifndef AOS_LOGGING_LOG_NAMER_H_ |
| 2 | #define AOS_LOGGING_LOG_NAMER_H_ |
| 3 | |
| 4 | #include <string> |
| 5 | |
| 6 | namespace aos { |
| 7 | namespace logging { |
| 8 | // Returns the correct filename to log to, blocking until the usb drive |
| 9 | // filesystem mounts, incrementing the number on the end of the filename, and |
| 10 | // setting up a symlink at basename-current. |
| 11 | // basename is the prefix to use for the logs within the usb drive. E.g., on a |
| 12 | // typical roborio setup, calling GetLogName("abc") will return a filename of |
| 13 | // the form "/media/sda1/abc-123" and setup a symlink pointing to it at |
| 14 | // "/media/sda1/abc-current". |
| 15 | std::string GetLogName(const char *basename); |
| 16 | } // namespace logging |
| 17 | } // namespace aos |
| 18 | |
| 19 | #endif // AOS_LOGGING_LOG_NAMER_H_ |