Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions jieba/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import sys
import time
import logging
from logging import NullHandler
import marshal
import tempfile
import threading
Expand All @@ -25,10 +26,8 @@
DEFAULT_DICT = None
DEFAULT_DICT_NAME = "dict.txt"

log_console = logging.StreamHandler(sys.stderr)
default_logger = logging.getLogger(__name__)
default_logger.setLevel(logging.DEBUG)
default_logger.addHandler(log_console)
default_logger.addHandler(NullHandler())

DICT_WRITING = {}

Expand Down Expand Up @@ -111,7 +110,10 @@ def initialize(self, dictionary=None):
if self.initialized:
return

default_logger.debug("Building prefix dict from %s ..." % (abs_path or 'the default dictionary'))
default_logger.debug(
"Building prefix dict from %s ..."
% (abs_path or 'the default dictionary')
)
t1 = time.time()
if self.cache_file:
cache_file = self.cache_file
Expand Down