@@ -277,18 +277,27 @@ msgid ""
277
277
"filter_maker`` in the filter configuration. You will need to change that if "
278
278
"you define it in a different module."
279
279
msgstr ""
280
+ "この関数は引数として与えられた文字列をログレベルの数値に変換し、ログレコード"
281
+ "内のログレベルが指定されたレベル以下の場合に ``True`` を返す関数を返します。"
282
+ "この例では ``filter_maker`` をコマンドラインから実行するテストスクリプト "
283
+ "``main.py`` で関数が定義されているため、フィルター設定上のモジュール名は "
284
+ "``__main__`` になります。そのためフィルター設定の中では ``__main__."
285
+ "filter_maker`` となります。異なるモジュールで関数を定義した場合、この部分を変"
286
+ "更する必要があります。"
280
287
281
288
#: ../../howto/logging-cookbook.rst:383
282
289
msgid "With the filter added, we can run ``main.py``, which in full is:"
283
290
msgstr ""
291
+ "フィルターを追加した ``main.py`` の全体像は以下のようになり、これで実行できる"
292
+ "状態になりました:"
284
293
285
294
#: ../../howto/logging-cookbook.rst:453
286
295
msgid "And after running it like this:"
287
- msgstr ""
296
+ msgstr "これを以下のように実行します: "
288
297
289
298
#: ../../howto/logging-cookbook.rst:459
290
299
msgid "We can see the results are as expected:"
291
- msgstr ""
300
+ msgstr "すると期待通りの結果を得ることができます: "
292
301
293
302
#: ../../howto/logging-cookbook.rst:485
294
303
msgid "Configuration server example"
@@ -409,6 +418,14 @@ msgid ""
409
418
"application, to use the above approach for logging, so that any blocking "
410
419
"code runs only in the ``QueueListener`` thread."
411
420
msgstr ""
421
+ "上述の議論は特に同期コードにについてのものではなく、むしろ遅いロギングハンド"
422
+ "ラについてでしたが、非同期コードやネットワーク、あるいはファイルハンドラから"
423
+ "のロギングでさえも (イベントループをブロックしてしまう) 問題につながる可能性"
424
+ "があることには注意すべきでしょう。これはいくつかのロギングが :mod:`asyncio` "
425
+ "内部で行われることが理由です。何らかの非同期コードがアプリケーションの中で使"
426
+ "われている場合、ロギングには上記のアプローチを使っていかなるブロッキングコー"
427
+ "ドも ``QueueListener`` スレッド内だけで実行されるようにしておくことが最も良い"
428
+ "でしょう。"
412
429
413
430
#: ../../howto/logging-cookbook.rst:615
414
431
msgid ""
@@ -477,7 +494,7 @@ msgstr ""
477
494
478
495
#: ../../howto/logging-cookbook.rst:766
479
496
msgid "Running a logging socket listener in production"
480
- msgstr ""
497
+ msgstr "作成中のロギングソケットのリスナーを実行する "
481
498
482
499
#: ../../howto/logging-cookbook.rst:770
483
500
msgid ""
@@ -486,78 +503,87 @@ msgid ""
486
503
"Gist <socket-listener-gist_>`__ which provides the bare-bones files to run "
487
504
"the above functionality using Supervisor. It consists of the following files:"
488
505
msgstr ""
506
+ "作成中のロギングリスナーを実行するためには、 `Supervisor <http://supervisord."
507
+ "org/>`_ のようなプロセス管理ツールを使う必要があるかもしれません。 `こちらの "
508
+ "Gist <socket-listener-gist_>`__ は Supervisor を使って上記の機能を実行するた"
509
+ "めの必要最低限のファイルを提供しています。以下のファイルが必要になります:"
489
510
490
511
#: ../../howto/logging-cookbook.rst:777
491
512
msgid "File"
492
- msgstr ""
513
+ msgstr "ファイル "
493
514
494
515
#: ../../howto/logging-cookbook.rst:777
495
516
msgid "Purpose"
496
517
msgstr "目的"
497
518
498
519
#: ../../howto/logging-cookbook.rst:779
499
520
msgid ":file:`prepare.sh`"
500
- msgstr ""
521
+ msgstr ":file:`prepare.sh` "
501
522
502
523
#: ../../howto/logging-cookbook.rst:779
503
524
msgid "A Bash script to prepare the environment for testing"
504
- msgstr ""
525
+ msgstr "試験用の環境を準備する Bash スクリプト "
505
526
506
527
#: ../../howto/logging-cookbook.rst:782
507
528
msgid ":file:`supervisor.conf`"
508
- msgstr ""
529
+ msgstr ":file:`supervisor.conf` "
509
530
510
531
#: ../../howto/logging-cookbook.rst:782
511
532
msgid ""
512
533
"The Supervisor configuration file, which has entries for the listener and a "
513
534
"multi-process web application"
514
535
msgstr ""
536
+ "リスナーとマルチプロセスの web アプリケーションのための設定を含む Supervisor "
537
+ "の設定ファイル"
515
538
516
539
#: ../../howto/logging-cookbook.rst:786
517
540
msgid ":file:`ensure_app.sh`"
518
- msgstr ""
541
+ msgstr ":file:`ensure_app.sh` "
519
542
520
543
#: ../../howto/logging-cookbook.rst:786
521
544
msgid ""
522
545
"A Bash script to ensure that Supervisor is running with the above "
523
546
"configuration"
524
547
msgstr ""
548
+ "Supervisor が上記の設定で実行されていることを保証するための Bash スクリプト"
525
549
526
550
#: ../../howto/logging-cookbook.rst:789
527
551
msgid ":file:`log_listener.py`"
528
- msgstr ""
552
+ msgstr ":file:`log_listener.py` "
529
553
530
554
#: ../../howto/logging-cookbook.rst:789
531
555
msgid ""
532
556
"The socket listener program which receives log events and records them to a "
533
557
"file"
534
- msgstr ""
558
+ msgstr "ログイベントを受信してファイルに記録するソケットリスナープログラム "
535
559
536
560
#: ../../howto/logging-cookbook.rst:792
537
561
msgid ":file:`main.py`"
538
- msgstr ""
562
+ msgstr ":file:`main.py` "
539
563
540
564
#: ../../howto/logging-cookbook.rst:792
541
565
msgid ""
542
566
"A simple web application which performs logging via a socket connected to "
543
567
"the listener"
544
568
msgstr ""
569
+ "リスナーに接続されたソケットを通じてロギングを実行する簡単な web アプリケー"
570
+ "ション"
545
571
546
572
#: ../../howto/logging-cookbook.rst:795
547
573
msgid ":file:`webapp.json`"
548
- msgstr ""
574
+ msgstr ":file:`webapp.json` "
549
575
550
576
#: ../../howto/logging-cookbook.rst:795
551
577
msgid "A JSON configuration file for the web application"
552
- msgstr ""
578
+ msgstr "web アプリケーションのための JSON 設定ファイル "
553
579
554
580
#: ../../howto/logging-cookbook.rst:797
555
581
msgid ":file:`client.py`"
556
- msgstr ""
582
+ msgstr ":file:`client.py` "
557
583
558
584
#: ../../howto/logging-cookbook.rst:797
559
585
msgid "A Python script to exercise the web application"
560
- msgstr ""
586
+ msgstr "web アプリケーションを起動するための Python スクリプト "
561
587
562
588
#: ../../howto/logging-cookbook.rst:800
563
589
msgid ""
@@ -567,20 +593,28 @@ msgid ""
567
593
"same log file without conflicting with one another --- they all go through "
568
594
"the socket listener."
569
595
msgstr ""
596
+ "この web アプリケーションは、リクエストを処理する複数のワーカープロセスを起動"
597
+ "する web アプリケーションサーバーである `Gunicorn <https://gunicorn.org/>`_ "
598
+ "を使っています。ここに例として挙げた設定は、複数のワーカーがいかにして互いに"
599
+ "衝突することなく同じログファイルに書き込みを行うことができるかを示しています "
600
+ "--- ワーカーは全てソケットリスナーを通じてログを書き込むのです。"
570
601
571
602
#: ../../howto/logging-cookbook.rst:805
572
603
msgid "To test these files, do the following in a POSIX environment:"
573
604
msgstr ""
605
+ "これらのファイルを試すためには、 POSIX 環境において以下を行なってください:"
574
606
575
607
#: ../../howto/logging-cookbook.rst:807
576
608
msgid ""
577
609
"Download `the Gist <socket-listener-gist_>`__ as a ZIP archive using the :"
578
610
"guilabel:`Download ZIP` button."
579
611
msgstr ""
612
+ ":guilabel:`Download ZIP` ボタンを押して `Gist <socket-listener-gist_>`__ を "
613
+ "ZIP アーカイブとしてダウンロードしてください。"
580
614
581
615
#: ../../howto/logging-cookbook.rst:810
582
616
msgid "Unzip the above files from the archive into a scratch directory."
583
- msgstr ""
617
+ msgstr "アーカイブファイルをスクラッチディレクトリに展開してください。 "
584
618
585
619
#: ../../howto/logging-cookbook.rst:812
586
620
msgid ""
@@ -589,18 +623,27 @@ msgid ""
589
623
"files, and a :file:`venv` subdirectory to contain a virtual environment into "
590
624
"which ``bottle``, ``gunicorn`` and ``supervisor`` are installed."
591
625
msgstr ""
626
+ "準備のために、スクラッチディレクトリにおいて ``bash prepare.sh`` を実行してく"
627
+ "ださい。これにより Supervisor 関連のファイルおよびログファイルのための :file:"
628
+ "`run` サブディレクトリ、および ``bottle``, ``gunicorn`` そして "
629
+ "``supervisor`` がインストールされる仮想環境を含む :file:`venv` サブディレクト"
630
+ "リが生成されます。"
592
631
593
632
#: ../../howto/logging-cookbook.rst:817
594
633
msgid ""
595
634
"Run ``bash ensure_app.sh`` to ensure that Supervisor is running with the "
596
635
"above configuration."
597
636
msgstr ""
637
+ "``bash ensure_app.sh`` を実行して Supervisor が上記の設定で実行されていること"
638
+ "を確認してください。"
598
639
599
640
#: ../../howto/logging-cookbook.rst:820
600
641
msgid ""
601
642
"Run ``venv/bin/python client.py`` to exercise the web application, which "
602
643
"will lead to records being written to the log."
603
644
msgstr ""
645
+ "``venv/bin/python client.py`` を実行して web アプリケーションを起動してくださ"
646
+ "い。これによりログにレコードが書き込まれるはずです。"
604
647
605
648
#: ../../howto/logging-cookbook.rst:823
606
649
msgid ""
@@ -609,18 +652,26 @@ msgid ""
609
652
"won't be in any particular order, since they have been handled concurrently "
610
653
"by different worker processes in a non-deterministic way."
611
654
msgstr ""
655
+ ":file:`run` サブディレクトリにあるログファイルを調べてください。最新のログ"
656
+ "は、パターン :file:`app.log*` に一致する名前のファイルにあるはずです。ログは"
657
+ "異なるワーカープロセスによって非決定論的な形で並行に処理されるため、特定の決"
658
+ "まった順番にはなりません。"
612
659
613
660
#: ../../howto/logging-cookbook.rst:828
614
661
msgid ""
615
662
"You can shut down the listener and the web application by running ``venv/bin/"
616
663
"supervisorctl -c supervisor.conf shutdown``."
617
664
msgstr ""
665
+ "リスナーと web アプリケーションは ``venv/bin/supervisorctl -c supervisor."
666
+ "conf shutdown`` を実行することでシャットダウンできます。"
618
667
619
668
#: ../../howto/logging-cookbook.rst:831
620
669
msgid ""
621
670
"You may need to tweak the configuration files in the unlikely event that the "
622
671
"configured ports clash with something else in your test environment."
623
672
msgstr ""
673
+ "ありそうもないことですが、テスト環境で設定したポートが別の設定と衝突してし"
674
+ "まった場合、設定ファイルを修正する必要があるかもしれません。"
624
675
625
676
#: ../../howto/logging-cookbook.rst:837
626
677
msgid "Adding contextual information to your logging output"
@@ -802,7 +853,7 @@ msgstr "実行すると、以下のようになります:"
802
853
803
854
#: ../../howto/logging-cookbook.rst:996
804
855
msgid "Use of ``contextvars``"
805
- msgstr ""
856
+ msgstr "``contextvars`` の利用 "
806
857
807
858
#: ../../howto/logging-cookbook.rst:998
808
859
msgid ""
@@ -813,6 +864,12 @@ msgid ""
813
864
"logs can populated with contextual information such as, for example, request "
814
865
"attributes handled by web applications."
815
866
msgstr ""
867
+ "Python 3.7 以降、 :mod:`contextvars` モジュールは :mod:`threading` と :mod:"
868
+ "`asyncio` の両方の処理上のニーズを満たすコンテキストローカルな変数を提供して"
869
+ "います。このタイプの変数はスレッドローカルな変数に適しています。以下の例は、"
870
+ "マルチスレッド環境において、 いかにして web アプリケーションによって処理され"
871
+ "るリクエスト属性のような処理の文脈上の情報とともにログを投入できるかを示しま"
872
+ "す。"
816
873
817
874
#: ../../howto/logging-cookbook.rst:1004
818
875
msgid ""
0 commit comments