We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
OffAxisProjectionPlot Failed when Log Level Set to Debug
### Bug report

**Bug summary**
If log level set to `debug`, then `OffAxisProjectionPlot` would fail when following the tutorial at [website](https://yt-project.org/doc/visualizing/plots.html#off-axis-projection-plots). 
Alhough this can be avoid by setting log level to `info`, it is kind of annoying when debugging.

**Code for reproduction**

```python
import yt

ds = yt.load("IsolatedGalaxy/galaxy0030/galaxy0030")
L = [1, 1, 0]  # vector normal to cutting plane
north_vector = [-1, 1, 0]
prj = yt.OffAxisProjectionPlot(
    ds, L, ("gas", "density"), width=(25, "kpc"), north_vector=north_vector
)
prj.save()
```

**Actual outcome**

```
yt : [DEBUG    ] 2021-10-15 13:54:47,845 Setting normalized vectors [-0.5 -0.5 -0.5] dimensionless None
Traceback (most recent call last):
  File "OffAxisProjectionPlot.py", line 6, in <module>
    prj = yt.OffAxisProjectionPlot(
  File "/home/calab912/software/python/python3.8/lib/python3.8/site-packages/yt/visualization/plot_window.py", line 2254, in __init__
    PWViewerMPL.__init__(
  File "/home/calab912/software/python/python3.8/lib/python3.8/site-packages/yt/visualization/plot_window.py", line 873, in __init__
    PlotWindow.__init__(self, *args, **kwargs)
  File "/home/calab912/software/python/python3.8/lib/python3.8/site-packages/yt/visualization/plot_window.py", line 257, in __init__
    self._setup_plots()
  File "/home/calab912/software/python/python3.8/lib/python3.8/site-packages/yt/visualization/plot_window.py", line 994, in _setup_plots
    self._recreate_frb()
  File "/home/calab912/software/python/python3.8/lib/python3.8/site-packages/yt/visualization/plot_window.py", line 317, in _recreate_frb
    self._frb._get_data_source_fields()
  File "/home/calab912/software/python/python3.8/lib/python3.8/site-packages/yt/visualization/fixed_resolution.py", line 176, in _get_data_source_fields
    self[f]
  File "/home/calab912/software/python/python3.8/lib/python3.8/site-packages/yt/visualization/fixed_resolution.py", line 602, in __getitem__
    buff = off_axis_projection(
  File "/home/calab912/software/python/python3.8/lib/python3.8/site-packages/yt/visualization/volume_rendering/off_axis_projection.py", line 341, in off_axis_projection
    camera.set_width(width)
  File "/home/calab912/software/python/python3.8/lib/python3.8/site-packages/yt/visualization/volume_rendering/camera.py", line 374, in set_width
    self.width = width
  File "/home/calab912/software/python/python3.8/lib/python3.8/site-packages/yt/visualization/volume_rendering/camera.py", line 208, in fset
    self.switch_orientation()
  File "/home/calab912/software/python/python3.8/lib/python3.8/site-packages/yt/visualization/volume_rendering/camera.py", line 441, in switch_orientation
    self._setup_normalized_vectors(normal_vector, north_vector)
  File "/home/calab912/software/python/python3.8/lib/python3.8/site-packages/yt/utilities/orientation.py", line 65, in _setup_normalized_vectors
    mylog.debug("Setting normalized vectors %s %s", normal_vector, north_vector)
  File "/home/calab912/software/python/python3.8/lib/python3.8/logging/__init__.py", line 1422, in debug
    self._log(DEBUG, msg, args, **kwargs)
  File "/home/calab912/software/python/python3.8/lib/python3.8/logging/__init__.py", line 1577, in _log
    self.handle(record)
  File "/home/calab912/software/python/python3.8/lib/python3.8/logging/__init__.py", line 1586, in handle
    if (not self.disabled) and self.filter(record):
  File "/home/calab912/software/python/python3.8/lib/python3.8/logging/__init__.py", line 807, in filter
    result = f.filter(record)
  File "/home/calab912/software/python/python3.8/lib/python3.8/site-packages/yt/utilities/logger.py", line 78, in filter
    if current_log != getattr(self, "last_log", None):
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
```

**Expected outcome**

![8270b9edbcab48d09023e31ed0967ea6galaxy0030_OffAxisProjection_density](https://user-images.githubusercontent.com/6188366/137440172-7e9bde2e-4a04-459b-b05a-8c41ef0d45e3.png)

**Version Information**
  * Operating System: Ubuntu 20.04
  * Python Version: 3.8
  * yt version: 4.1.dev `yt/main` commit `e387a2`
  * Install from source code via pip.


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `yt/utilities/orientation.py`
Content:
```
1 import numpy as np
2 
3 from yt.funcs import mylog
4 from yt.units.yt_array import YTArray
5 from yt.utilities.exceptions import YTException
6 
7 
8 def _aligned(a, b):
9     aligned_component = np.abs(np.dot(a, b) / np.linalg.norm(a) / np.linalg.norm(b))
10     return np.isclose(aligned_component, 1.0, 1.0e-13)
11 
12 
13 def _validate_unit_vectors(normal_vector, north_vector):
14 
15     # Make sure vectors are unitless
16     if north_vector is not None:
17         north_vector = YTArray(north_vector, "", dtype="float64")
18     if normal_vector is not None:
19         normal_vector = YTArray(normal_vector, "", dtype="float64")
20 
21     if not np.dot(normal_vector, normal_vector) > 0:
22         raise YTException("normal_vector cannot be the zero vector.")
23     if north_vector is not None and _aligned(north_vector, normal_vector):
24         raise YTException("normal_vector and north_vector cannot be aligned.")
25 
26     return normal_vector, north_vector
27 
28 
29 class Orientation:
30     def __init__(self, normal_vector, north_vector=None, steady_north=False):
31         r"""An object that returns a set of basis vectors for orienting
32         cameras a data containers.
33 
34         Parameters
35         ----------
36         normal_vector : array_like
37            A vector normal to the image plane
38         north_vector  : array_like, optional
39            The 'up' direction to orient the image plane.
40            If not specified, gets calculated automatically
41         steady_north  : bool, optional
42            Boolean to control whether to normalize the north_vector
43            by subtracting off the dot product of it and the normal
44            vector.  Makes it easier to do rotations along a single
45            axis.  If north_vector is specified, is switched to
46            True.  Default: False
47 
48         """
49 
50         normal_vector, north_vector = _validate_unit_vectors(
51             normal_vector, north_vector
52         )
53         self.steady_north = steady_north
54         if north_vector is not None:
55             self.steady_north = True
56         self.north_vector = north_vector
57         self._setup_normalized_vectors(normal_vector, north_vector)
58         if self.north_vector is None:
59             self.north_vector = self.unit_vectors[1]
60 
61     def _setup_normalized_vectors(self, normal_vector, north_vector):
62         normal_vector, north_vector = _validate_unit_vectors(
63             normal_vector, north_vector
64         )
65         mylog.debug("Setting normalized vectors %s %s", normal_vector, north_vector)
66         # Now we set up our various vectors
67         normal_vector /= np.sqrt(np.dot(normal_vector, normal_vector))
68         if north_vector is None:
69             vecs = np.identity(3)
70             t = np.cross(normal_vector, vecs).sum(axis=1)
71             ax = t.argmax()
72             east_vector = np.cross(vecs[ax, :], normal_vector).ravel()
73             # self.north_vector must remain None otherwise rotations about a fixed axis
74             # will break. The north_vector calculated here will still be included
75             # in self.unit_vectors.
76             north_vector = np.cross(normal_vector, east_vector).ravel()
77         else:
78             if self.steady_north or (np.dot(north_vector, normal_vector) != 0.0):
79                 north_vector = (
80                     north_vector - np.dot(north_vector, normal_vector) * normal_vector
81                 )
82             east_vector = np.cross(north_vector, normal_vector).ravel()
83         north_vector /= np.sqrt(np.dot(north_vector, north_vector))
84         east_vector /= np.sqrt(np.dot(east_vector, east_vector))
85         self.normal_vector = normal_vector
86         self.north_vector = north_vector
87         self.unit_vectors = YTArray([east_vector, north_vector, normal_vector], "")
88         self.inv_mat = np.linalg.pinv(self.unit_vectors)
89
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/yt/utilities/orientation.py b/yt/utilities/orientation.py
--- a/yt/utilities/orientation.py
+++ b/yt/utilities/orientation.py
@@ -1,6 +1,5 @@
 import numpy as np
 
-from yt.funcs import mylog
 from yt.units.yt_array import YTArray
 from yt.utilities.exceptions import YTException
 
@@ -62,7 +61,6 @@
         normal_vector, north_vector = _validate_unit_vectors(
             normal_vector, north_vector
         )
-        mylog.debug("Setting normalized vectors %s %s", normal_vector, north_vector)
         # Now we set up our various vectors
         normal_vector /= np.sqrt(np.dot(normal_vector, normal_vector))
         if north_vector is None:

{"golden_diff": "diff --git a/yt/utilities/orientation.py b/yt/utilities/orientation.py\n--- a/yt/utilities/orientation.py\n+++ b/yt/utilities/orientation.py\n@@ -1,6 +1,5 @@\n import numpy as np\n \n-from yt.funcs import mylog\n from yt.units.yt_array import YTArray\n from yt.utilities.exceptions import YTException\n \n@@ -62,7 +61,6 @@\n         normal_vector, north_vector = _validate_unit_vectors(\n             normal_vector, north_vector\n         )\n-        mylog.debug(\"Setting normalized vectors %s %s\", normal_vector, north_vector)\n         # Now we set up our various vectors\n         normal_vector /= np.sqrt(np.dot(normal_vector, normal_vector))\n         if north_vector is None:\n", "issue": "OffAxisProjectionPlot Failed when Log Level Set to Debug\n### Bug report\r\n\r\n**Bug summary**\r\nIf log level set to `debug`, then `OffAxisProjectionPlot` would fail when following the tutorial at [website](https://yt-project.org/doc/visualizing/plots.html#off-axis-projection-plots). \r\nAlhough this can be avoid by setting log level to `info`, it is kind of annoying when debugging.\r\n\r\n**Code for reproduction**\r\n\r\n```python\r\nimport yt\r\n\r\nds = yt.load(\"IsolatedGalaxy/galaxy0030/galaxy0030\")\r\nL = [1, 1, 0]  # vector normal to cutting plane\r\nnorth_vector = [-1, 1, 0]\r\nprj = yt.OffAxisProjectionPlot(\r\n    ds, L, (\"gas\", \"density\"), width=(25, \"kpc\"), north_vector=north_vector\r\n)\r\nprj.save()\r\n```\r\n\r\n**Actual outcome**\r\n\r\n```\r\nyt : [DEBUG    ] 2021-10-15 13:54:47,845 Setting normalized vectors [-0.5 -0.5 -0.5] dimensionless None\r\nTraceback (most recent call last):\r\n  File \"OffAxisProjectionPlot.py\", line 6, in <module>\r\n    prj = yt.OffAxisProjectionPlot(\r\n  File \"/home/calab912/software/python/python3.8/lib/python3.8/site-packages/yt/visualization/plot_window.py\", line 2254, in __init__\r\n    PWViewerMPL.__init__(\r\n  File \"/home/calab912/software/python/python3.8/lib/python3.8/site-packages/yt/visualization/plot_window.py\", line 873, in __init__\r\n    PlotWindow.__init__(self, *args, **kwargs)\r\n  File \"/home/calab912/software/python/python3.8/lib/python3.8/site-packages/yt/visualization/plot_window.py\", line 257, in __init__\r\n    self._setup_plots()\r\n  File \"/home/calab912/software/python/python3.8/lib/python3.8/site-packages/yt/visualization/plot_window.py\", line 994, in _setup_plots\r\n    self._recreate_frb()\r\n  File \"/home/calab912/software/python/python3.8/lib/python3.8/site-packages/yt/visualization/plot_window.py\", line 317, in _recreate_frb\r\n    self._frb._get_data_source_fields()\r\n  File \"/home/calab912/software/python/python3.8/lib/python3.8/site-packages/yt/visualization/fixed_resolution.py\", line 176, in _get_data_source_fields\r\n    self[f]\r\n  File \"/home/calab912/software/python/python3.8/lib/python3.8/site-packages/yt/visualization/fixed_resolution.py\", line 602, in __getitem__\r\n    buff = off_axis_projection(\r\n  File \"/home/calab912/software/python/python3.8/lib/python3.8/site-packages/yt/visualization/volume_rendering/off_axis_projection.py\", line 341, in off_axis_projection\r\n    camera.set_width(width)\r\n  File \"/home/calab912/software/python/python3.8/lib/python3.8/site-packages/yt/visualization/volume_rendering/camera.py\", line 374, in set_width\r\n    self.width = width\r\n  File \"/home/calab912/software/python/python3.8/lib/python3.8/site-packages/yt/visualization/volume_rendering/camera.py\", line 208, in fset\r\n    self.switch_orientation()\r\n  File \"/home/calab912/software/python/python3.8/lib/python3.8/site-packages/yt/visualization/volume_rendering/camera.py\", line 441, in switch_orientation\r\n    self._setup_normalized_vectors(normal_vector, north_vector)\r\n  File \"/home/calab912/software/python/python3.8/lib/python3.8/site-packages/yt/utilities/orientation.py\", line 65, in _setup_normalized_vectors\r\n    mylog.debug(\"Setting normalized vectors %s %s\", normal_vector, north_vector)\r\n  File \"/home/calab912/software/python/python3.8/lib/python3.8/logging/__init__.py\", line 1422, in debug\r\n    self._log(DEBUG, msg, args, **kwargs)\r\n  File \"/home/calab912/software/python/python3.8/lib/python3.8/logging/__init__.py\", line 1577, in _log\r\n    self.handle(record)\r\n  File \"/home/calab912/software/python/python3.8/lib/python3.8/logging/__init__.py\", line 1586, in handle\r\n    if (not self.disabled) and self.filter(record):\r\n  File \"/home/calab912/software/python/python3.8/lib/python3.8/logging/__init__.py\", line 807, in filter\r\n    result = f.filter(record)\r\n  File \"/home/calab912/software/python/python3.8/lib/python3.8/site-packages/yt/utilities/logger.py\", line 78, in filter\r\n    if current_log != getattr(self, \"last_log\", None):\r\nValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()\r\n```\r\n\r\n**Expected outcome**\r\n\r\n![8270b9edbcab48d09023e31ed0967ea6galaxy0030_OffAxisProjection_density](https://user-images.githubusercontent.com/6188366/137440172-7e9bde2e-4a04-459b-b05a-8c41ef0d45e3.png)\r\n\r\n**Version Information**\r\n  * Operating System: Ubuntu 20.04\r\n  * Python Version: 3.8\r\n  * yt version: 4.1.dev `yt/main` commit `e387a2`\r\n  * Install from source code via pip.\r\n\n", "before_files": [{"content": "import numpy as np\n\nfrom yt.funcs import mylog\nfrom yt.units.yt_array import YTArray\nfrom yt.utilities.exceptions import YTException\n\n\ndef _aligned(a, b):\n    aligned_component = np.abs(np.dot(a, b) / np.linalg.norm(a) / np.linalg.norm(b))\n    return np.isclose(aligned_component, 1.0, 1.0e-13)\n\n\ndef _validate_unit_vectors(normal_vector, north_vector):\n\n    # Make sure vectors are unitless\n    if north_vector is not None:\n        north_vector = YTArray(north_vector, \"\", dtype=\"float64\")\n    if normal_vector is not None:\n        normal_vector = YTArray(normal_vector, \"\", dtype=\"float64\")\n\n    if not np.dot(normal_vector, normal_vector) > 0:\n        raise YTException(\"normal_vector cannot be the zero vector.\")\n    if north_vector is not None and _aligned(north_vector, normal_vector):\n        raise YTException(\"normal_vector and north_vector cannot be aligned.\")\n\n    return normal_vector, north_vector\n\n\nclass Orientation:\n    def __init__(self, normal_vector, north_vector=None, steady_north=False):\n        r\"\"\"An object that returns a set of basis vectors for orienting\n        cameras a data containers.\n\n        Parameters\n        ----------\n        normal_vector : array_like\n           A vector normal to the image plane\n        north_vector  : array_like, optional\n           The 'up' direction to orient the image plane.\n           If not specified, gets calculated automatically\n        steady_north  : bool, optional\n           Boolean to control whether to normalize the north_vector\n           by subtracting off the dot product of it and the normal\n           vector.  Makes it easier to do rotations along a single\n           axis.  If north_vector is specified, is switched to\n           True.  Default: False\n\n        \"\"\"\n\n        normal_vector, north_vector = _validate_unit_vectors(\n            normal_vector, north_vector\n        )\n        self.steady_north = steady_north\n        if north_vector is not None:\n            self.steady_north = True\n        self.north_vector = north_vector\n        self._setup_normalized_vectors(normal_vector, north_vector)\n        if self.north_vector is None:\n            self.north_vector = self.unit_vectors[1]\n\n    def _setup_normalized_vectors(self, normal_vector, north_vector):\n        normal_vector, north_vector = _validate_unit_vectors(\n            normal_vector, north_vector\n        )\n        mylog.debug(\"Setting normalized vectors %s %s\", normal_vector, north_vector)\n        # Now we set up our various vectors\n        normal_vector /= np.sqrt(np.dot(normal_vector, normal_vector))\n        if north_vector is None:\n            vecs = np.identity(3)\n            t = np.cross(normal_vector, vecs).sum(axis=1)\n            ax = t.argmax()\n            east_vector = np.cross(vecs[ax, :], normal_vector).ravel()\n            # self.north_vector must remain None otherwise rotations about a fixed axis\n            # will break. The north_vector calculated here will still be included\n            # in self.unit_vectors.\n            north_vector = np.cross(normal_vector, east_vector).ravel()\n        else:\n            if self.steady_north or (np.dot(north_vector, normal_vector) != 0.0):\n                north_vector = (\n                    north_vector - np.dot(north_vector, normal_vector) * normal_vector\n                )\n            east_vector = np.cross(north_vector, normal_vector).ravel()\n        north_vector /= np.sqrt(np.dot(north_vector, north_vector))\n        east_vector /= np.sqrt(np.dot(east_vector, east_vector))\n        self.normal_vector = normal_vector\n        self.north_vector = north_vector\n        self.unit_vectors = YTArray([east_vector, north_vector, normal_vector], \"\")\n        self.inv_mat = np.linalg.pinv(self.unit_vectors)\n", "path": "yt/utilities/orientation.py"}], "after_files": [{"content": "import numpy as np\n\nfrom yt.units.yt_array import YTArray\nfrom yt.utilities.exceptions import YTException\n\n\ndef _aligned(a, b):\n    aligned_component = np.abs(np.dot(a, b) / np.linalg.norm(a) / np.linalg.norm(b))\n    return np.isclose(aligned_component, 1.0, 1.0e-13)\n\n\ndef _validate_unit_vectors(normal_vector, north_vector):\n\n    # Make sure vectors are unitless\n    if north_vector is not None:\n        north_vector = YTArray(north_vector, \"\", dtype=\"float64\")\n    if normal_vector is not None:\n        normal_vector = YTArray(normal_vector, \"\", dtype=\"float64\")\n\n    if not np.dot(normal_vector, normal_vector) > 0:\n        raise YTException(\"normal_vector cannot be the zero vector.\")\n    if north_vector is not None and _aligned(north_vector, normal_vector):\n        raise YTException(\"normal_vector and north_vector cannot be aligned.\")\n\n    return normal_vector, north_vector\n\n\nclass Orientation:\n    def __init__(self, normal_vector, north_vector=None, steady_north=False):\n        r\"\"\"An object that returns a set of basis vectors for orienting\n        cameras a data containers.\n\n        Parameters\n        ----------\n        normal_vector : array_like\n           A vector normal to the image plane\n        north_vector  : array_like, optional\n           The 'up' direction to orient the image plane.\n           If not specified, gets calculated automatically\n        steady_north  : bool, optional\n           Boolean to control whether to normalize the north_vector\n           by subtracting off the dot product of it and the normal\n           vector.  Makes it easier to do rotations along a single\n           axis.  If north_vector is specified, is switched to\n           True.  Default: False\n\n        \"\"\"\n\n        normal_vector, north_vector = _validate_unit_vectors(\n            normal_vector, north_vector\n        )\n        self.steady_north = steady_north\n        if north_vector is not None:\n            self.steady_north = True\n        self.north_vector = north_vector\n        self._setup_normalized_vectors(normal_vector, north_vector)\n        if self.north_vector is None:\n            self.north_vector = self.unit_vectors[1]\n\n    def _setup_normalized_vectors(self, normal_vector, north_vector):\n        normal_vector, north_vector = _validate_unit_vectors(\n            normal_vector, north_vector\n        )\n        # Now we set up our various vectors\n        normal_vector /= np.sqrt(np.dot(normal_vector, normal_vector))\n        if north_vector is None:\n            vecs = np.identity(3)\n            t = np.cross(normal_vector, vecs).sum(axis=1)\n            ax = t.argmax()\n            east_vector = np.cross(vecs[ax, :], normal_vector).ravel()\n            # self.north_vector must remain None otherwise rotations about a fixed axis\n            # will break. The north_vector calculated here will still be included\n            # in self.unit_vectors.\n            north_vector = np.cross(normal_vector, east_vector).ravel()\n        else:\n            if self.steady_north or (np.dot(north_vector, normal_vector) != 0.0):\n                north_vector = (\n                    north_vector - np.dot(north_vector, normal_vector) * normal_vector\n                )\n            east_vector = np.cross(north_vector, normal_vector).ravel()\n        north_vector /= np.sqrt(np.dot(north_vector, north_vector))\n        east_vector /= np.sqrt(np.dot(east_vector, east_vector))\n        self.normal_vector = normal_vector\n        self.north_vector = north_vector\n        self.unit_vectors = YTArray([east_vector, north_vector, normal_vector], \"\")\n        self.inv_mat = np.linalg.pinv(self.unit_vectors)\n", "path": "yt/utilities/orientation.py"}]}