mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-05-28 21:54:10 -04:00
LogManager: implement system module, client api, logging api (#1617)
Some notes: * Unless `atmosphere!enable_log_manager` is true, Nintendo's log manager will be used instead. * This prevents paying memory costs for LM when not enabling logging. * To facilitate this, Atmosphere's log manager has a different program id from Nintendo's. * `atmosphere!enable_htc` implies `atmosphere!enable_log_manager`. * LogManager logs to tma, and the SD card (if `lm!enable_sd_card_logging` is true, which it is by default). * Binary logs are saved to `lm!sd_card_log_output_directory`, which is `atmosphere/binlogs` by default.
This commit is contained in:
parent
a1fb8a91c8
commit
e9849c74cf
94 changed files with 5595 additions and 45 deletions
|
@ -88,6 +88,17 @@ namespace ams::os {
|
|||
|
||||
using WaitAnyFunction = WaitableHolderType * (*)(WaitableManagerType *);
|
||||
|
||||
class NotBoolButInt {
|
||||
private:
|
||||
int m_value;
|
||||
public:
|
||||
constexpr ALWAYS_INLINE NotBoolButInt(int v) : m_value(v) { /* ... */ }
|
||||
|
||||
constexpr ALWAYS_INLINE operator int() const { return m_value; }
|
||||
|
||||
explicit operator bool() const = delete;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
template<typename... Args> requires (sizeof...(Args) > 0)
|
||||
|
@ -100,4 +111,14 @@ namespace ams::os {
|
|||
return impl::WaitAnyImpl(static_cast<impl::WaitAnyFunction>(&::ams::os::WaitAny), std::forward<Args>(args)...).second;
|
||||
}
|
||||
|
||||
template<typename... Args> requires (sizeof...(Args) > 0)
|
||||
inline std::pair<WaitableHolderType *, int> TryWaitAny(WaitableManagerType *manager, Args &&... args) {
|
||||
return impl::WaitAnyImpl(static_cast<impl::WaitAnyFunction>(&::ams::os::TryWaitAny), manager, std::forward<Args>(args)...);
|
||||
}
|
||||
|
||||
template<typename... Args> requires (sizeof...(Args) > 0)
|
||||
inline impl::NotBoolButInt TryWaitAny(Args &&... args) {
|
||||
return impl::WaitAnyImpl(static_cast<impl::WaitAnyFunction>(&::ams::os::TryWaitAny), std::forward<Args>(args)...).second;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue