logPathFor method

String logPathFor(
  1. ServiceDescriptor d
)

Resolves the log file path: under OMNYSHELL_HOME when the descriptor sets it, else %LOCALAPPDATA%\OmnyShell\<role>.log.

Implementation

String logPathFor(svc.ServiceDescriptor d) {
  final home = d.environment['OMNYSHELL_HOME'];
  if (home != null && home.isNotEmpty) {
    return '$home\\${d.serviceName}.log';
  }
  final local =
      Platform.environment['LOCALAPPDATA'] ??
      Platform.environment['APPDATA'] ??
      Directory.systemTemp.path;
  return '$local\\OmnyShell\\${d.serviceName}.log';
}