diff options
author | Filipe David Borba Manana <fdmanana@apache.org> | 2011-05-11 15:32:03 +0000 |
---|---|---|
committer | Filipe David Borba Manana <fdmanana@apache.org> | 2011-05-11 15:32:03 +0000 |
commit | 52d18a368aeb1f67cb9dc35ff9135b558a196399 (patch) | |
tree | 131ccd8d287b6727f3bfd61df416a851f156aab6 /src/couchdb | |
parent | fc90ac341c154eac58780d8040263cb3df62512d (diff) |
Merged revision 1101896 from trunk
Fix logger crash when messages have unicode characters
This closes COUCHDB-1158. Thanks Dale Harvey.
git-svn-id: https://svn.apache.org/repos/asf/couchdb/branches/1.1.x@1101924 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/couchdb')
-rw-r--r-- | src/couchdb/couch_log.erl | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/couchdb/couch_log.erl b/src/couchdb/couch_log.erl index 9813f812..b3d3297c 100644 --- a/src/couchdb/couch_log.erl +++ b/src/couchdb/couch_log.erl @@ -174,10 +174,10 @@ log(Fd, ConsoleMsg, FileMsg) -> ok = io:put_chars(Fd, FileMsg). get_log_messages(Pid, Level, Format, Args) -> - ConsoleMsg = io_lib:format( - "[~s] [~p] " ++ Format ++ "~n", [Level, Pid | Args]), + ConsoleMsg = unicode:characters_to_binary(io_lib:format( + "[~s] [~p] " ++ Format ++ "~n", [Level, Pid | Args])), FileMsg = ["[", httpd_util:rfc1123_date(), "] ", ConsoleMsg], - {iolist_to_binary(ConsoleMsg), iolist_to_binary(FileMsg)}. + {ConsoleMsg, iolist_to_binary(FileMsg)}. read(Bytes, Offset) -> LogFileName = couch_config:get("log", "file"), |