[][src]Struct casual_logger::Log

pub struct Log {}

Easy to use logging.
使いやすいロギング。

Implementations

impl Log[src]

pub fn set_file_name(prefix: &str)[src]

Set the log file name prefix.
ログ・ファイル名接頭辞を設定します。

Example of Log file name:
ログ・ファイル名の例:

| tic-tac-toe-2020-07-11.log.toml
| 1---------- 3--------
| 2----------
|
| 1 Prefix 3 Extention
| 接頭辞 拡張子
| 2 StartDate
| 開始日
+

StartDate is basically today.
If the rotation fails, it is the start date.

.log to be safe, include a word that
clearly states that you can delete the file.

See also: 'Log::set_file_name_important()'.

pub fn get_file_name() -> Result<String, String>[src]

Example:

If 'tic-tac-toe-2020-07-11.log.toml', This is 'tic-tac-toe'.

pub fn set_file_name_important(prefix: &str)[src]

For application use. No for library use.
アプリケーションでの使用向け。 ライブラリ向けではありません。

Set the log file name prefix. The file name cannot be changed later.
ログ・ファイル名接頭辞を設定します。ファイル名は後で変更できません。

Example of Log file name:
ログ・ファイル名の例:

| tic-tac-toe-2020-07-11.log.toml
| 1---------- 3--------
| 2----------
|
| 1 Prefix 3 Extention
| 接頭辞 拡張子
| 2 StartDate
| 開始日
+

StartDate is basically today.
If the rotation fails, it is the start date.

.log to be safe, include a word that
clearly states that you can delete the file.

See also: 'Log::set_file_name()'.

pub fn set_file_ext(ext: Extension)[src]

Log file extension.
'.log.toml' or '.log'.
If you don't like the .toml extension, change.

pub fn set_file_ext_important(ext: Extension)[src]

The file extension cannot be changed later.
ファイル名は後で変更できません。

See also: Log::set_file_ext().

pub fn get_file_ext_str() -> Result<String, String>[src]

Example:

If 'tic-tac-toe-2020-07-11.log.toml', This is '.log.toml'.

pub fn set_level(level: Level)[src]

Logs with lower priority than this level will not
be written.

|<-- Low Level --------------------- High level -->|
|<-- High priority --------------- Low priority -->|
|Fatal< Error < Warn < Notice < Info < Debug <Trace|

pub fn set_level_important(level: Level)[src]

The level cannot be changed later.
レベルは後で変更できません。

See also: Log::set_level().

pub fn get_level() -> Result<Level, String>[src]

Example:

If 'tic-tac-toe-2020-07-11.log.toml', This is '.log.toml'.

pub fn set_retention_days(days: i64)[src]

You probably don't need to set this. Default: 7.
Check the StartDate in the file name and delete it if it is old.

pub fn set_retention_days_important(retention_days: i64)[src]

The file retention days cannot be changed later.
ファイル保持日数は後で変更できません。

See also: Log::set_retention_days().

pub fn get_retention_days() -> Result<i64, String>[src]

The file retention days.
ファイル保持日数。

pub fn set_timeout_secs(secs: u64)[src]

You probably don't need to set this. Default: 30.
Wait for seconds logging to complete.

pub fn set_timeout_secs_important(secs: u64)[src]

The timeout seconds cannot be changed later.
タイムアウト秒は後で変更できません。

See also: Log::set_timeout_secs().

pub fn get_timeout_secs() -> Result<u64, String>[src]

The timeout seconds.
タイムアウト秒。

pub fn set_opt(optimization: Opt)[src]

Optimization.

pub fn set_opt_important(optimization: Opt)[src]

The optimization cannot be changed later.
最適化は後で変更できません。

See also: Log::set_opt().

pub fn get_opt() -> Result<Opt, String>[src]

Optimization.
最適化。

pub fn remove_old_logs() -> usize[src]

Returns

Number of deleted log files.

pub fn wait()[src]

👎 Deprecated since 0.5.1:

Please use the casual_logger::Log::flush() method instead

Wait for logging to complete.

See also: Log::set_timeout_secs(), Log::set_opt().

pub fn flush()[src]

Wait for logging to complete.

See also: Log::set_timeout_secs(), Log::set_opt().

pub fn enabled(level: Level) -> bool[src]

Check level.

pub fn trace(message: &str)[src]

Trace level. No trailing newline.

pub fn traceln(message: &str)[src]

Trace level. There is a trailing newline.

pub fn trace_t(message: &str, table: &mut Table)[src]

Trace level. No trailing newline. Use table.

pub fn traceln_t(message: &str, table: &mut Table)[src]

Trace level. There is a trailing newline. Use table.

pub fn debug(message: &str)[src]

Debug level. No trailing newline.

pub fn debugln(message: &str)[src]

Debug level. There is a trailing newline.

pub fn debug_t(message: &str, table: &mut Table)[src]

Debug level. No trailing newline. Use table.

pub fn debugln_t(message: &str, table: &mut Table)[src]

Debug level. There is a trailing newline. Use table.

pub fn info(message: &str)[src]

Info level. No trailing newline.

pub fn infoln(message: &str)[src]

Info level. There is a trailing newline.

pub fn info_t(message: &str, table: &mut Table)[src]

Info level. No trailing newline. Use table.

pub fn infoln_t(message: &str, table: &mut Table)[src]

Info level. There is a trailing newline. Use table.

pub fn notice(message: &str)[src]

Notice level. No trailing newline.

pub fn noticeln(message: &str)[src]

Notice level. There is a trailing newline.

pub fn notice_t(message: &str, table: &mut Table)[src]

Notice level. No trailing newline. Use table.

pub fn noticeln_t(message: &str, table: &mut Table)[src]

Notice level. There is a trailing newline. Use table.

pub fn warn(message: &str)[src]

Warning level. No trailing newline.

pub fn warnln(message: &str)[src]

Warning level. There is a trailing newline.

pub fn warn_t(message: &str, table: &mut Table)[src]

Warning level. No trailing newline. Use table.

pub fn warnln_t(message: &str, table: &mut Table)[src]

Warning level. There is a trailing newline. Use table.

pub fn error(message: &str)[src]

Error level. No trailing newline.

pub fn errorln(message: &str)[src]

Error level. There is a trailing newline.

pub fn error_t(message: &str, table: &mut Table)[src]

Error level. No trailing newline. Use table.

pub fn errorln_t(message: &str, table: &mut Table)[src]

Error level. There is a trailing newline. Use table.

pub fn fatal(message: &str) -> String[src]

Fatal level. No trailing newline. Fatal is Panic! Can be used as the first argument of.

pub fn fatalln(message: &str) -> String[src]

Fatal level. There is a trailing newline. Fatal is Panic! Can be used as the first argument of.

pub fn fatal_t(message: &str, table: &mut Table) -> String[src]

Fatal level. No trailing newline. Fatal is Panic! Can be used as the first argument of.

pub fn fatalln_t(message: &str, table: &mut Table) -> String[src]

Fatal level. There is a trailing newline. Fatal is Panic! Can be used as the first argument of.

Auto Trait Implementations

impl RefUnwindSafe for Log

impl Send for Log

impl Sync for Log

impl Unpin for Log

impl UnwindSafe for Log

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.