Loading files
56ae2e47fThis file is pinned to the selected release. Download the original to open it in your design tool.
Files from this revision, including CAD and LFS contents. Git history is not included.
Or in GitHub Desktop, choose File → Clone repository → URL and paste this address.
Public repositories can be cloned without signing in. For pushing, use your ThingAtlas username and a Git access token as the password.
git lfs install git clone https://thingatlas.com/git/-unclaimed/openharness-1322671404.git
Includes Git history, branches, and Git LFS files. Clones the repository’s default branch, regardless of the version shown here.
56ae2e47fThis file is pinned to the selected release. Download the original to open it in your design tool.
import 'app_log.dart';
import 'debug_surface.dart';
import 'log_file.dart';
import 'log_stream.dart';
import 'log_stream_sinks.dart';
/// Base name of the per-day file under `~/.harness/logs`.
const String kAppLogBase = 'app';
/// Point [appLog] at real files under `~/.harness/logs`, and — in
/// a build that has the Debug screen — at the in-memory [logStream] as well.
///
/// Called once from `main()`. Nothing else calls it, which is what keeps the
/// suite honest: the app log defaults to a no-op, so `flutter test` cannot
/// write into a real Harness home no matter which code path it exercises — the
/// same rule analytics follows.
///
/// Deliberately not `async`: the first lines this app writes are the ones about
/// starting up, and awaiting a directory probe here would lose them.
void installFileLogs() {
final directory = DailyLogFile.defaultDirectory;
final file = FileAppLog(DailyLogFile(directory, kAppLogBase));
if (!kDebugSurfaceEnabled) {
appLog = file;
return;
}
// The file first in the fan-out: if the mirror ever throws, the durable
// copy is already written.
appLog = FanoutAppLog([file, StreamAppLog(logStream)]);
}