Difference between revisions of "Log services"

From Nintendo Switch Brew
Jump to navigation Jump to search
(Rename ILogger command 0 from Initialize to Log. I doubt the original service name is Initialize, and this is more in line with what the actual function does; given this is used heavily by some games to fire out debug info.)
(Document the interfaces for ILogService and ILogger)
Line 6: Line 6:
 
! Cmd || Name
 
! Cmd || Name
 
|-
 
|-
| 0 || OpenLogger
+
| 0 || [[#OpenLogger]]
 
|}
 
|}
 +
 +
== OpenLogger ==
 +
 +
Takes an input u64 value representing a process ID and returns an [[#ILogger]] instance.
  
 
== ILogger ==
 
== ILogger ==
Line 16: Line 20:
 
! Cmd || Name
 
! Cmd || Name
 
|-
 
|-
| 0 || Log
+
| 0 || [[#Log]]
 +
|-
 +
| 1 || [3.0.0+] [[#SetDestination]]
 +
|}
 +
 
 +
== Log ==
 +
 
 +
Takes an input buffer containing the message to log.
 +
Will always return successfully.
 +
 
 +
== SetDestination ==
 +
 
 +
Takes an input u32 mask value indicating the logging destinations to send incoming log messages to. The mask entries are as follows:
 +
 
 +
{| class="wikitable" border="1"
 +
|-
 +
! Value || Description
 +
|-
 +
| 1 || Unknown
 +
|-
 +
| 2 || UART
 +
|-
 +
| 4 || UART when sleeping
 
|-
 
|-
| 1 || [3.0.0+] SetDestination
+
| 0xFFFF || Log to all destinations
 
|}
 
|}
  

Revision as of 23:11, 8 May 2019

lm

This is "nn::lm::ILogService".

Cmd Name
0 #OpenLogger

OpenLogger

Takes an input u64 value representing a process ID and returns an #ILogger instance.

ILogger

This is "nn::lm::ILogger".

Cmd Name
0 #Log
1 [3.0.0+] #SetDestination

Log

Takes an input buffer containing the message to log. Will always return successfully.

SetDestination

Takes an input u32 mask value indicating the logging destinations to send incoming log messages to. The mask entries are as follows:

Value Description
1 Unknown
2 UART
4 UART when sleeping
0xFFFF Log to all destinations

lm:get

This is "nn::lm::ILogGetter".

Cmd Name
0 StartLogging
1 StopLogging
2 GetLog

This service doesn't normally exist on retail.