1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-16 15:32:43 +01:00

Make 'logger' a std::unique_ptr

This prevents it from being leaked (see
bb411e4ae1 for an example of this).
This commit is contained in:
Eelco Dolstra 2022-08-25 16:57:03 +02:00
parent 1f688d62d7
commit 2018413e3e
8 changed files with 45 additions and 42 deletions

View file

@ -180,11 +180,11 @@ struct PushActivity
~PushActivity() { setCurActivity(prevAct); }
};
extern Logger * logger;
extern std::unique_ptr<Logger> logger;
Logger * makeSimpleLogger(bool printBuildLogs = true);
std::unique_ptr<Logger> makeSimpleLogger(bool printBuildLogs = true);
Logger * makeJSONLogger(Descriptor fd);
std::unique_ptr<Logger> makeJSONLogger(Descriptor fd);
/**
* @param source A noun phrase describing the source of the message, e.g. "the builder".