Commit afa335ff authored by James Deikun's avatar James Deikun

move module-specific logging to the modules that use it

parent b2e60010
Pipeline #22992800 passed with stages
in 21 minutes and 53 seconds
(**************************************************************************)
(* *)
(* Copyright (c) 2014 - 2018. *)
(* Dynamic Ledger Solutions, Inc. <contact@tezos.com> *)
(* *)
(* All rights reserved. No warranty, explicit or implicit, provided. *)
(* *)
(**************************************************************************)
include Tezos_stdlib.Logging.Make(struct let name = "node.main" end)
(**************************************************************************)
(* *)
(* Copyright (c) 2014 - 2018. *)
(* Dynamic Ledger Solutions, Inc. <contact@tezos.com> *)
(* *)
(* All rights reserved. No warranty, explicit or implicit, provided. *)
(* *)
(**************************************************************************)
include Tezos_stdlib.Logging.LOG
......@@ -7,7 +7,7 @@
(* *)
(**************************************************************************)
open Logging.Node.Main
open Node_logging
let genesis : State.Chain.genesis = {
time =
......
......@@ -8,7 +8,7 @@
(**************************************************************************)
open Cmdliner
open Logging.Node.Main
open Node_logging
let (//) = Filename.concat
......
......@@ -7,7 +7,7 @@
(* *)
(**************************************************************************)
let log = Logging.Client.Sign.lwt_log_notice
let log = Signer_logging.lwt_log_notice
let sign (cctxt : #Client_context.wallet) pkh data =
log "Request for signing %d bytes of data for key %a, magic byte = %02X"
......
......@@ -7,7 +7,7 @@
(* *)
(**************************************************************************)
let log = Logging.Client.Sign.lwt_log_notice
let log = Signer_logging.lwt_log_notice
let run (cctxt : #Client_context.wallet) ~host ~port ~cert ~key =
log "Accepting HTTPS requests on port %d" port >>= fun () ->
......
(**************************************************************************)
(* *)
(* Copyright (c) 2014 - 2018. *)
(* Dynamic Ledger Solutions, Inc. <contact@tezos.com> *)
(* *)
(* All rights reserved. No warranty, explicit or implicit, provided. *)
(* *)
(**************************************************************************)
include Tezos_stdlib.Logging.Make(struct let name = "client.signer" end)
(**************************************************************************)
(* *)
(* Copyright (c) 2014 - 2018. *)
(* Dynamic Ledger Solutions, Inc. <contact@tezos.com> *)
(* *)
(* All rights reserved. No warranty, explicit or implicit, provided. *)
(* *)
(**************************************************************************)
include Tezos_stdlib.Logging.LOG
......@@ -9,7 +9,7 @@
open Signer_messages
let log = Logging.Client.Sign.lwt_log_notice
let log = Signer_logging.lwt_log_notice
let run (cctxt : #Client_context.wallet) path =
Lwt_utils_unix.Socket.bind path >>=? fun fd ->
......
(**************************************************************************)
(* *)
(* Copyright (c) 2014 - 2018. *)
(* Dynamic Ledger Solutions, Inc. <contact@tezos.com> *)
(* *)
(* All rights reserved. No warranty, explicit or implicit, provided. *)
(* *)
(**************************************************************************)
include Tezos_stdlib.Logging.Make(struct let name = "base" end)
(**************************************************************************)
(* *)
(* Copyright (c) 2014 - 2018. *)
(* Dynamic Ledger Solutions, Inc. <contact@tezos.com> *)
(* *)
(* All rights reserved. No warranty, explicit or implicit, provided. *)
(* *)
(**************************************************************************)
include Tezos_stdlib.Logging.LOG
......@@ -18,7 +18,7 @@ let () =
| Exit -> ()
| exn ->
let backtrace = Printexc.get_backtrace () in
Logging.Node.Main.fatal_error "@[<v 2>%a%a@]"
Base_logging.fatal_error "@[<v 2>%a%a@]"
(fun ppf exn ->
Format.fprintf ppf
"@[Uncaught (asynchronous) exception (%d):@ %a@]"
......
......@@ -7,7 +7,7 @@
(* *)
(**************************************************************************)
open Logging.Updater
open Updater_logging
let (//) = Filename.concat
......
(**************************************************************************)
(* *)
(* Copyright (c) 2014 - 2018. *)
(* Dynamic Ledger Solutions, Inc. <contact@tezos.com> *)
(* *)
(* All rights reserved. No warranty, explicit or implicit, provided. *)
(* *)
(**************************************************************************)
include Tezos_stdlib.Logging.Make(struct let name = "updater" end)
(**************************************************************************)
(* *)
(* Copyright (c) 2014 - 2018. *)
(* Dynamic Ledger Solutions, Inc. <contact@tezos.com> *)
(* *)
(* All rights reserved. No warranty, explicit or implicit, provided. *)
(* *)
(**************************************************************************)
include Tezos_stdlib.Logging.LOG
(**************************************************************************)
(* *)
(* Copyright (c) 2014 - 2018. *)
(* Dynamic Ledger Solutions, Inc. <contact@tezos.com> *)
(* *)
(* All rights reserved. No warranty, explicit or implicit, provided. *)
(* *)
(**************************************************************************)
include Tezos_stdlib.Logging.Make(struct let name = "rpc" end)
(**************************************************************************)
(* *)
(* Copyright (c) 2014 - 2018. *)
(* Dynamic Ledger Solutions, Inc. <contact@tezos.com> *)
(* *)
(* All rights reserved. No warranty, explicit or implicit, provided. *)
(* *)
(**************************************************************************)
include Tezos_stdlib.Logging.LOG
......@@ -12,4 +12,4 @@ type cors = Resto_cohttp.Cors.t = {
allowed_origins : string list ;
}
include Resto_cohttp.Server.Make(RPC_encoding)(Logging.RPC)
include Resto_cohttp.Server.Make(RPC_encoding)(RPC_logging)
......@@ -7,7 +7,7 @@
(* *)
(**************************************************************************)
open Logging.Node.State
open State_logging
let mempool_encoding = Mempool.encoding
......
......@@ -8,7 +8,7 @@
(**************************************************************************)
open Lwt.Infix
open Logging.Node.Worker
open Worker_logging
let inject_operation validator ?chain_id bytes =
let t =
......
......@@ -7,7 +7,7 @@
(* *)
(**************************************************************************)
open Logging.RPC
open RPC_logging
let filter_bi operations (bi: Block_services.block_info) =
let bi = if operations then bi else { bi with operations = None } in
......
......@@ -7,7 +7,7 @@
(* *)
(**************************************************************************)
open Logging.Node.State
open State_logging
open Validation_errors
module Shared = struct
......
(**************************************************************************)
(* *)
(* Copyright (c) 2014 - 2018. *)
(* Dynamic Ledger Solutions, Inc. <contact@tezos.com> *)
(* *)
(* All rights reserved. No warranty, explicit or implicit, provided. *)
(* *)
(**************************************************************************)
include Tezos_stdlib.Logging.Make(struct let name = "node.state" end)
(**************************************************************************)
(* *)
(* Copyright (c) 2014 - 2018. *)
(* Dynamic Ledger Solutions, Inc. <contact@tezos.com> *)
(* *)
(* All rights reserved. No warranty, explicit or implicit, provided. *)
(* *)
(**************************************************************************)
include Tezos_stdlib.Logging.LOG
(**************************************************************************)
(* *)
(* Copyright (c) 2014 - 2018. *)
(* Dynamic Ledger Solutions, Inc. <contact@tezos.com> *)
(* *)
(* All rights reserved. No warranty, explicit or implicit, provided. *)
(* *)
(**************************************************************************)
include Tezos_stdlib.Logging.Make(struct let name = "node.worker" end)
(**************************************************************************)
(* *)
(* Copyright (c) 2014 - 2018. *)
(* Dynamic Ledger Solutions, Inc. <contact@tezos.com> *)
(* *)
(* All rights reserved. No warranty, explicit or implicit, provided. *)
(* *)
(**************************************************************************)
include Tezos_stdlib.Logging.LOG
......@@ -67,26 +67,6 @@ module Make(S : sig val name: string end) : LOG = struct
end
module Core = Make(struct let name = "core" end)
module P2p = Make(struct let name = "p2p" end)
module RPC = Make(struct let name = "rpc" end)
module Db = Make(struct let name = "db" end)
module Updater = Make(struct let name = "updater" end)
module Node = struct
module State = Make(struct let name = "node.state" end)
module Validator = Make(struct let name = "node.validator" end)
module Prevalidator = Make(struct let name = "node.prevalidator" end)
module Discoverer = Make(struct let name = "node.discoverer" end)
module Worker = Make(struct let name = "node.worker" end)
module Main = Make(struct let name = "node.main" end)
end
module Client = struct
module Blocks = Make(struct let name = "client.blocks" end)
module Baking = Make(struct let name = "client.baking" end)
module Endorsement = Make(struct let name = "client.endorsement" end)
module Revelation = Make(struct let name = "client.revealation" end)
module Denunciation = Make(struct let name = "client.denunciation" end)
module Sign = Make(struct let name = "client.signer" end)
end
type level = Lwt_log_core.level =
| Debug
......
......@@ -26,26 +26,6 @@ module type LOG = sig
end
module Core : LOG
module P2p : LOG
module RPC : LOG
module Db : LOG
module Updater : LOG
module Node : sig
module State : LOG
module Validator : LOG
module Prevalidator : LOG
module Discoverer : LOG
module Worker : LOG
module Main : LOG
end
module Client : sig
module Blocks : LOG
module Baking : LOG
module Endorsement : LOG
module Revelation : LOG
module Denunciation : LOG
module Sign : LOG
end
module Make(S: sig val name: string end) : LOG
......
......@@ -18,7 +18,7 @@ module Make_value (V : ENCODED_VALUE) = struct
let to_bytes v =
try Data_encoding.Binary.to_bytes_exn V.encoding v
with Data_encoding.Binary.Write_error error ->
Logging.Node.State.log_error
Store_logging.log_error
"Exception while serializing value %a"
Data_encoding.Binary.pp_write_error error ;
MBytes.create 0
......
(**************************************************************************)
(* *)
(* Copyright (c) 2014 - 2018. *)
(* Dynamic Ledger Solutions, Inc. <contact@tezos.com> *)
(* *)
(* All rights reserved. No warranty, explicit or implicit, provided. *)
(* *)
(**************************************************************************)
include Tezos_stdlib.Logging.Make(struct let name = "db" end)
(**************************************************************************)
(* *)
(* Copyright (c) 2014 - 2018. *)
(* Dynamic Ledger Solutions, Inc. <contact@tezos.com> *)
(* *)
(* All rights reserved. No warranty, explicit or implicit, provided. *)
(* *)
(**************************************************************************)
include Tezos_stdlib.Logging.LOG
......@@ -7,7 +7,7 @@
(* *)
(**************************************************************************)
open Logging.Client.Denunciation
include Logging.Make(struct let name = "client.denunciation" end)
let create cctxt endorsement_stream =
let last_get_endorsement = ref None in
......
......@@ -10,7 +10,7 @@
open Proto_alpha
open Alpha_context
open Logging.Client.Endorsement
include Logging.Make(struct let name = "client.endorsement" end)
module State : sig
......
......@@ -10,7 +10,7 @@
open Proto_alpha
open Alpha_context
open Logging.Client.Baking
include Logging.Make(struct let name = "client.baking" end)
let generate_proof_of_work_nonce () =
Rand.generate Constants.proof_of_work_nonce_size
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment