From dd9dcfa363f6219d30b5f229fa8097c03395698e Mon Sep 17 00:00:00 2001 From: Magnus Ahltorp Date: Thu, 29 Jan 2015 13:56:43 +0100 Subject: Log leaf hashes as hex strings --- src/perm.erl | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/perm.erl') diff --git a/src/perm.erl b/src/perm.erl index 614656a..0cbe6cb 100644 --- a/src/perm.erl +++ b/src/perm.erl @@ -56,19 +56,19 @@ ensurefile_nosync(Rootdir, Key, Content) -> ensurefile(Rootdir, Key, Content, nosync). ensurefile(Rootdir, Key, Content, Syncflag) -> - lager:debug("dir ~p key ~p", [Rootdir, Key]), + lager:debug("dir ~p key ~s", [Rootdir, mochihex:to_hex(Key)]), {Dirs, Path} = path_for_key(Rootdir, Key), case readfile_and_verify(Path, Content) of ok -> - lager:debug("key ~p existed, fsync", [Key]), + lager:debug("key ~s existed, fsync", [mochihex:to_hex(Key)]), ok = util:fsync([Path, Rootdir | Dirs]), - lager:debug("key ~p fsynced", [Key]), + lager:debug("key ~s fsynced", [mochihex:to_hex(Key)]), ok; differ -> - lager:debug("key ~p existed, was different", [Key]), + lager:debug("key ~s existed, was different", [mochihex:to_hex(Key)]), differ; {error, enoent} -> - lager:debug("key ~p didn't exist, add", [Key]), + lager:debug("key ~s didn't exist, add", [mochihex:to_hex(Key)]), util:check_error(make_dirs([Rootdir, Rootdir ++ "nursery/"] ++ Dirs), makedir, "Error creating directory"), @@ -77,9 +77,9 @@ ensurefile(Rootdir, Key, Content, Syncflag) -> util:write_tempfile_and_rename(Path, NurseryName, Content), case Syncflag of sync -> - lager:debug("key ~p added, fsync", [Key]), + lager:debug("key ~s added, fsync", [mochihex:to_hex(Key)]), ok = util:fsync([Path, Rootdir | Dirs]), - lager:debug("key ~p fsynced", [Key]), + lager:debug("key ~s fsynced", [mochihex:to_hex(Key)]), ok; nosync -> ok -- cgit v1.1