diff --git a/src/otp/Erlang.fs b/src/otp/Erlang.fs index 42c37ff..d2715d3 100644 --- a/src/otp/Erlang.fs +++ b/src/otp/Erlang.fs @@ -123,6 +123,10 @@ let systemTime (unit: Atom) : int = nativeOnly [] let systemTimeSec () : int = nativeOnly +/// Hash a term to a value in [0, Range). Useful for partitioning or load balancing. +[] +let phash2 (term: obj) (range: int) : int = nativeOnly + /// Schedule a message to be sent to self after Ms milliseconds. [] let sendAfter (ms: int) (msg: obj) : TimerRef = nativeOnly diff --git a/src/otp/Logger.fs b/src/otp/Logger.fs index 113f229..4a5fc3f 100644 --- a/src/otp/Logger.fs +++ b/src/otp/Logger.fs @@ -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) -> 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 []