Трудный прокомментировать Ваш конкретный случай. Если settings.py выполняется дважды, то нормально, что Вы получаете две строки для каждого отправленного журнала.
у Нас была та же проблема, таким образом, мы настраиваем ее в наших проектах выделить один модуль входу. То, что модули имеют "одноэлементный шаблон" модуля, так, чтобы мы только выполнили интересный код однажды.
Это похоже на это:
def init_logging():
stdoutHandler = logging.StreamHandler( sys.stdout )
stdoutHandler.setLevel( DEBUG )
stdoutHandler.setFormatter( logging.Formatter( LOG_FORMAT_WITH_TIME ) )
logging.getLogger( LOG_AREA1 ).addHandler( stdoutHandler )
logInitDone=False #global variable controlling the singleton.
if not logInitDone:
logInitDone = True
init_logging()
Импорт log.py первый раз настроит вход правильно.
Step #1: Wrap whatever it is you want centered on the screen in a full-screen RelativeLayout
.
Step #2: Give that child view (the one, which you want centered inside the RelativeLayout
) the android:layout_centerInParent="true"
attribute.
You can apply a centering to any View, including a Layout, by using the XML attribute android:layout_gravity". You probably want to give it the value "center".
You can find a reference of possible values for this option here: http://developer.android.com/reference/android/widget/LinearLayout.LayoutParams.html#attr_android:layout_gravity
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/relLayout1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center">
<ProgressBar
android:id="@+id/ProgressBar01"
android:layout_centerInParent="true"
android:layout_width="wrap_content"
android:layout_gravity="center"
android:layout_height="wrap_content"></ProgressBar>
<TextView
android:layout_below="@id/ProgressBar01"
android:text="@string/please_wait_authenticating"
android:id="@+id/txtText"
android:paddingTop="30px"
android:layout_width="wrap_content"
android:layout_height="wrap_content"></TextView>
</RelativeLayout>