mirror of
https://github.com/Zygo/bees.git
synced 2025-06-17 01:56:16 +02:00
log: BEESLOGNOTE doesn't do what we think it does
BEESLOGNOTE was intended to combine BEESLOG and BEESNOTE, i.e. write a log message and set the task status message from a single expression. With the log levels we would now need several more variants (BEESLOGNOTEDEBUG, BEESLOGNOTEERR...) or a parameter (BEESNOTELOG(DEBUG, ...)). Or we give up on the idea. This combination was used only 3 times so far. The log messages and the note message have different editorial styles. Remove the three instances of BEESLOGNOTE, and make the BEESLOGNOTE definition equvalent to BEESLOG at LOG_NOTICE level for consistency. Signed-off-by: Zygo Blaxell <bees@furryterror.org>
This commit is contained in:
@ -610,12 +610,15 @@ BeesHashTable::open_file()
|
||||
// If that doesn't work, try to make a new one
|
||||
if (!new_fd) {
|
||||
string tmp_filename = m_filename + ".tmp";
|
||||
BEESLOGNOTE("creating new hash table '" << tmp_filename << "'");
|
||||
BEESNOTE("creating new hash table '" << tmp_filename << "'");
|
||||
BEESLOGINFO("Creating new hash table '" << tmp_filename << "'");
|
||||
unlinkat(m_ctx->home_fd(), tmp_filename.c_str(), 0);
|
||||
new_fd = openat_or_die(m_ctx->home_fd(), tmp_filename, FLAGS_CREATE_FILE, 0700);
|
||||
BEESLOGNOTE("truncating new hash table '" << tmp_filename << "' size " << m_size << " (" << pretty(m_size) << ")");
|
||||
BEESNOTE("truncating new hash table '" << tmp_filename << "' size " << m_size << " (" << pretty(m_size) << ")");
|
||||
BEESLOGINFO("Truncating new hash table '" << tmp_filename << "' size " << m_size << " (" << pretty(m_size) << ")");
|
||||
ftruncate_or_die(new_fd, m_size);
|
||||
BEESLOGNOTE("truncating new hash table '" << tmp_filename << "' -> '" << m_filename << "'");
|
||||
BEESNOTE("truncating new hash table '" << tmp_filename << "' -> '" << m_filename << "'");
|
||||
BEESLOGINFO("Truncating new hash table '" << tmp_filename << "' -> '" << m_filename << "'");
|
||||
renameat_or_die(m_ctx->home_fd(), tmp_filename, m_ctx->home_fd(), m_filename);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user