Berkas Konfigurasi

EFB has an overall configuration file to manage all enabled modules. It is located under the directory of current profile, and named config.yaml.

Sintaks

Berkas konfigurasi berada di sintaks YAML. Jika anda tidak akrab dengan sintaks tersebut, silahkan periksa dokumentasi dan tutorial tersebut untuk rinciannya.

  • ID dari saluran induk diaktifkan di bawah tombol saluran_induk

  • ID dari saluran slave yang diaktifkan adalah yang tercantum di bawah tombol saluran_slave. Ini harus dijadikan sebuah daftar meskipun hanya satu saluran yang bisa diaktifkan.

  • ID dari middleware yang diaktifkan adalah yang tercantum di bawah tombol middleware. Ini harus dijadikan sebuah daftar meskipun hanya satu middleware yang bisa diaktifkan. Namun, Apabila anda tidak menginginkan untuk mengaktifkan middleware apapun, hanya menghilangkan bagian sepenuhnya.

Contoh ID

To have multiple accounts running simultaneously, you can appoint an instance ID to a module. Instance ID can be defined by the user, and if defined, it must has nothing other than letters, numbers and underscores, i.e. in regular expressions [a-zA-Z0-9_]+. When instance ID is not defined, the channel will run in the "default" instance with no instance ID.

To indicate the instance ID of an instance, append # following by the instance ID to the module ID. For example, slave channel bar.dummy running with instance ID alice should be written as bar.dummy#alice. If the channel requires configurations, it should be done in the directory with the same name (e.g. EFB_DATA_PATH/profiles/PROFILE/bar.dummy#alice), so as to isolate instances.

Hindari memiliki dua modul dengan penetapan yang sama dari modul ID dan contoh ID seperti itu mungkin menyebabkan hasil yang tak terduga.

For example, to enable the following modules:

  • Saluran utama
    • Demo Master (foo.demo_master)

  • Slave channels
    • Demo Slave (foo.demo_slave)

    • Dummy Slave (bar.dummy)

    • Budak tiruan (bar.dummy) di alt contoh

  • Middlewares
    • Message Archiver (foo.msg_archiver)

    • Null Middleware (foo.null)

config.yaml should have the following lines:

master_channel: foo.demo_master
slave_channels:
- foo.demo_slave
- bar.dummy
- bar.dummy#alt
middlewares:
- foo.msg_archiver
- foo.null

Granulated logging control

If you have special needs on processing and controlling the log produced by the framework and running modules, you can use specify the log configuration with Python's configuration dictionary schema under section logging.

An example of logging control settings:

logging:
    version: 1
    disable_existing_loggers: false
    formatters:
        standard:
            format: '%(asctime)s [%(levelname)s] %(name)s: %(message)s'
    handlers:
        default:
            level: INFO
            formatter: standard
            class: logging.StreamHandler
            stream: ext://sys.stdout
    loggers:
          '':
                handlers: [default,]
                level: INFO
                propagate: true
          AliceIRCChannel:
                handlers: [default, ]
                level: WARN
                propagate: false