Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 4 additions & 0 deletions src/otp/Erlang.fs
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,10 @@ let systemTime (unit: Atom) : int = nativeOnly
[<Emit("erlang:system_time(second)")>]
let systemTimeSec () : int = nativeOnly

/// Hash a term to a value in [0, Range). Useful for partitioning or load balancing.
[<Emit("erlang:phash2($0, $1)")>]
let phash2 (term: obj) (range: int) : int = nativeOnly

/// Schedule a message to be sent to self after Ms milliseconds.
[<Emit("erlang:send_after($0, erlang:self(), $1)")>]
let sendAfter (ms: int) (msg: obj) : TimerRef = nativeOnly
Expand Down
7 changes: 4 additions & 3 deletions src/otp/Logger.fs
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,10 @@ type IExports =
abstract debug: msg: string * metadataOrArgs: obj -> unit
/// Set the primary logger configuration. Common use: set_primary_config(atom "level", atom "debug")
abstract set_primary_config: key: Atom * value: Atom -> unit
/// Add a primary filter. Filters run before handler filters and can stop or modify events.
/// The filter is a tuple {FilterFun, Extra} where FilterFun is fun(LogEvent, Extra) -> stop | ignore | LogEvent.
abstract add_primary_filter: id: Atom * filter: (System.Func<obj, obj, obj> * obj) -> unit
/// Update a handler's configuration. Common use: change formatter template.
abstract update_handler_config: handler: Atom * key: Atom * value: obj -> unit
/// Add a primary filter. The filter is an opaque {FilterFun, Extra} tuple.
abstract add_primary_filter: id: Atom * filter: obj -> unit

/// logger module
[<ImportAll("logger")>]
Expand Down
Loading